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

nepada / file-upload-control / 8503722650

01 Apr 2024 04:14AM UTC coverage: 90.293%. Remained the same
8503722650

Pull #152

github

web-flow
Update php-parallel-lint/php-parallel-lint requirement

Updates the requirements on [php-parallel-lint/php-parallel-lint](https://github.com/php-parallel-lint/PHP-Parallel-Lint) to permit the latest version.
- [Release notes](https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases)
- [Changelog](https://github.com/php-parallel-lint/PHP-Parallel-Lint/blob/v1.4.0/CHANGELOG.md)
- [Commits](https://github.com/php-parallel-lint/PHP-Parallel-Lint/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: php-parallel-lint/php-parallel-lint
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #152: Update php-parallel-lint/php-parallel-lint requirement from 1.3.2 to 1.4.0

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

© 2025 Coveralls, Inc