Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 0 |
1 | <?php |
||
34 | 51 | public static function createName($target) |
|
35 | { |
||
36 | 51 | if (!$target) |
|
37 | { |
||
38 | return 'unknown'; |
||
39 | } |
||
40 | 51 | if ($target instanceof ReflectionMethod) |
|
41 | { |
||
42 | 11 | return $target->getDeclaringClass()->name . '@' . $target->name . '()'; |
|
43 | } |
||
44 | 51 | elseif ($target instanceof ReflectionProperty) |
|
45 | { |
||
46 | 24 | return $target->getDeclaringClass()->name . '@$' . $target->name; |
|
47 | } |
||
48 | else |
||
49 | { |
||
50 | 51 | return $target->name; |
|
51 | } |
||
52 | } |
||
53 | |||
55 |