| Conditions | 5 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.0342 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 3 | public function __construct(mixed $data) |
|
| 24 | { |
||
| 25 | 3 | if ($data instanceof UploadedFileInterface) { |
|
| 26 | 1 | $this->data = [$data]; |
|
| 27 | 3 | } elseif (!is_array($data)) { |
|
| 28 | 2 | throw new InvalidArgumentException('Data should contain array of uploaded files'); |
|
| 29 | } else { |
||
| 30 | 3 | foreach ($data as $file) { |
|
| 31 | 2 | if (!$file instanceof UploadedFileInterface) { |
|
| 32 | throw new InvalidArgumentException('Data should contain UploadedFileInterface objects only'); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 3 | $this->data = $data; |
|
| 36 | } |
||
| 39 |