Conditions | 10 |
Paths | 10 |
Total Lines | 25 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
61 | private function getTypeStub(?\ReflectionType $type) |
||
62 | { |
||
63 | if (null === $type) { |
||
64 | return uniqid('', null); |
||
65 | } |
||
66 | |||
67 | switch ($type->getName()) { |
||
68 | case 'string': |
||
69 | return uniqid('', null); |
||
70 | case 'bool': |
||
71 | return (bool) rand(0, 1); |
||
72 | case 'float': |
||
73 | return rand(0, 100) / rand(1, 10); |
||
74 | case 'int': |
||
75 | return rand(0, 100); |
||
76 | case 'void': |
||
77 | return null; |
||
78 | case 'Throwable': |
||
79 | return new \Exception(); |
||
80 | case 'callable': |
||
81 | return function () {}; |
||
82 | case 'array': |
||
83 | return array_fill(0, 2, uniqid('', true)); |
||
84 | default: |
||
85 | throw new \UnexpectedValueException('Unknow type. '.$type->getName()); |
||
86 | } |
||
89 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths