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