| Conditions | 5 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5.4742 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 20 | static public function getParentFileName(\ReflectionClass $class, array &$files) |
|
| 19 | { |
||
| 20 | 20 | $parent = $class->getParentClass(); |
|
| 21 | 20 | if(!$parent){ |
|
| 22 | 20 | return; |
|
| 23 | } |
||
| 24 | 1 | if($parent->getFileName()){ |
|
| 25 | 1 | $files[] = $parent->getFileName(); |
|
| 26 | 1 | self::getParentFileName($parent, $files); |
|
| 27 | 1 | } |
|
| 28 | 1 | foreach ($class->getInterfaces() as $interface){ |
|
| 29 | if($interface->getFileName()){ |
||
| 30 | $files[] = $interface->getFileName(); |
||
| 31 | self::getParentFileName($interface, $files); |
||
| 32 | } |
||
| 33 | 1 | } |
|
| 34 | 1 | } |
|
| 35 | } |
||
| 36 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.