Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function __construct($payload) |
||
19 | { |
||
20 | if (\is_string($payload)) { |
||
21 | $this->path = $payload; |
||
22 | } elseif (\is_array($payload)) { |
||
23 | $this->path = $payload['path'] ?? null; |
||
24 | $this->name = $payload['name'] ?? null; |
||
25 | } |
||
26 | |||
27 | if (!file_exists($this->path)) { |
||
28 | throw new FileNotFoundException($this->path); |
||
29 | } |
||
30 | |||
31 | $this->name = $this->name ?? basename($this->path); |
||
32 | } |
||
33 | |||
61 |