| Conditions | 4 |
| Paths | 4 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public static function ns($class) |
||
| 24 | { |
||
| 25 | $info = new \ReflectionClass($class); |
||
| 26 | $path = dirname($info->getFileName()); |
||
| 27 | $ns = $info->getNamespaceName(); |
||
| 28 | $classNames = []; |
||
| 29 | foreach (new \DirectoryIterator($path) as $fileInfo) |
||
| 30 | { |
||
| 31 | $name = $fileInfo->getFilename(); |
||
| 32 | |||
| 33 | // Only files |
||
| 34 | if (!$fileInfo->isFile()) |
||
| 35 | { |
||
| 36 | continue; |
||
| 37 | } |
||
| 38 | |||
| 39 | // Only php |
||
| 40 | if (!preg_match('~\.php$~', $name)) |
||
| 41 | { |
||
| 42 | continue; |
||
| 43 | } |
||
| 44 | $classNames[] = sprintf('%s\%s', $ns, basename($name, '.php')); |
||
| 45 | } |
||
| 46 | sort($classNames); |
||
| 47 | return $classNames; |
||
| 48 | } |
||
| 49 | |||
| 51 |