| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public static function fromPath(\SplFileInfo $path) |
||
| 12 | { |
||
| 13 | $pathName = $path->getPathname(); |
||
| 14 | |||
| 15 | if (strpos($path, ':') === strlen($pathName) - 1) { |
||
| 16 | $pathName = sprintf('%s//', $pathName); |
||
| 17 | } |
||
| 18 | |||
| 19 | $directory = new \FilesystemIterator($pathName, \FilesystemIterator::CURRENT_AS_FILEINFO); |
||
| 20 | |||
| 21 | return new self($directory, function (\SplFileInfo $file) { |
||
| 22 | return $file->isFile(); |
||
| 23 | }); |
||
| 24 | } |
||
| 25 | } |