• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nepada / file-upload-control / 11118481205

01 Oct 2024 04:10AM UTC coverage: 90.293%. Remained the same
11118481205

Pull #164

github

web-flow
Update composer/semver requirement from 3.4.2 to 3.4.3

Updates the requirements on [composer/semver](https://github.com/composer/semver) to permit the latest version.
- [Release notes](https://github.com/composer/semver/releases)
- [Changelog](https://github.com/composer/semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/composer/semver/compare/3.4.2...3.4.3)

---
updated-dependencies:
- dependency-name: composer/semver
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #164: Update composer/semver requirement from 3.4.2 to 3.4.3

679 of 752 relevant lines covered (90.29%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/src/FileUploadControl/Storage/FileUploadChunk.php
1
<?php
2
declare(strict_types = 1);
3

4
namespace Nepada\FileUploadControl\Storage;
5

6
use Nette;
7

8
final class FileUploadChunk
9
{
10

11
    use Nette\SmartObject;
12

13
    public readonly Nette\Http\FileUpload $fileUpload;
14

15
    public readonly ContentRange $contentRange;
16

17
    private function __construct(Nette\Http\FileUpload $fileUpload, ContentRange $contentRange)
1✔
18
    {
19
        if (! $fileUpload->isOk()) {
1✔
20
            throw new \InvalidArgumentException("Expected successful file upload, but upload of '{$fileUpload->getUntrustedName()}' has failed with error {$fileUpload->getError()}.");
1✔
21
        }
22

23
        if ($fileUpload->getSize() !== $contentRange->getRangeSize()) {
1✔
24
            throw new \InvalidArgumentException(sprintf(
1✔
25
                'Content range size of %d does not match file upload size %d.',
1✔
26
                $contentRange->getRangeSize(),
1✔
27
                $fileUpload->getSize(),
1✔
28
            ));
29
        }
30

31
        $this->fileUpload = $fileUpload;
1✔
32
        $this->contentRange = $contentRange;
1✔
33
    }
1✔
34

35
    public static function completeUpload(Nette\Http\FileUpload $fileUpload): self
1✔
36
    {
37
        return new self($fileUpload, ContentRange::ofSize($fileUpload->getSize()));
1✔
38
    }
39

40
    public static function partialUpload(Nette\Http\FileUpload $fileUpload, ContentRange $contentRange): self
1✔
41
    {
42
        return new self($fileUpload, $contentRange);
1✔
43
    }
44

45
    /**
46
     * @deprecated read the property directly instead
47
     */
48
    public function getFileUpload(): Nette\Http\FileUpload
49
    {
50
        return $this->fileUpload;
×
51
    }
52

53
    /**
54
     * @deprecated read the property directly instead
55
     */
56
    public function getContentRange(): ContentRange
57
    {
58
        return $this->contentRange;
×
59
    }
60

61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc