Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function __construct($file) |
||
18 | { |
||
19 | if ($file instanceof SplFileInfo) { |
||
20 | $this->file = $file; |
||
21 | } elseif (is_string($file)) { |
||
22 | $this->file = new SplFileInfo($file, dirname($file), basename($file)); |
||
23 | } else { |
||
24 | throw new \InvalidArgumentException(sprintf( |
||
25 | 'Unsupported file, string or "%s" instance is waiting.', |
||
26 | SplFileInfo::class |
||
27 | )); |
||
28 | } |
||
29 | } |
||
30 | |||
70 | } |