| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public static function classPath($self, $pathSuffix = null): string |
||
| 18 | { |
||
| 19 | $class = $self; |
||
| 20 | |||
| 21 | if (is_object($self)) { |
||
| 22 | $class = get_class($self); |
||
| 23 | } |
||
| 24 | |||
| 25 | $reflector = new \ReflectionClass($class); |
||
| 26 | |||
| 27 | $path = dirname($reflector->getFileName()); |
||
| 28 | |||
| 29 | if ($pathSuffix) { |
||
| 30 | $path .= DIRECTORY_SEPARATOR . ltrim($pathSuffix, DIRECTORY_SEPARATOR); |
||
| 31 | } |
||
| 32 | |||
| 33 | return Path::canonical($path); |
||
| 34 | } |
||
| 36 |