| Conditions | 4 |
| Paths | 8 |
| Total Lines | 53 |
| Code Lines | 35 |
| 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 |
||
| 28 | public static function getSubscribingMethods() |
||
| 29 | { |
||
| 30 | $methods = []; |
||
| 31 | |||
| 32 | foreach (self::SUPPORTED_FORMATS as $format) { |
||
| 33 | $methods[] = [ |
||
| 34 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
||
| 35 | 'type' => Iterator::class, |
||
| 36 | 'format' => $format, |
||
| 37 | 'method' => 'serializeIterable', |
||
| 38 | ]; |
||
| 39 | |||
| 40 | $methods[] = [ |
||
| 41 | 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION, |
||
| 42 | 'type' => Iterator::class, |
||
| 43 | 'format' => $format, |
||
| 44 | 'method' => 'deserializeIterator', |
||
| 45 | ]; |
||
| 46 | } |
||
| 47 | |||
| 48 | foreach (self::SUPPORTED_FORMATS as $format) { |
||
| 49 | $methods[] = [ |
||
| 50 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
||
| 51 | 'type' => ArrayIterator::class, |
||
| 52 | 'format' => $format, |
||
| 53 | 'method' => 'serializeIterable', |
||
| 54 | ]; |
||
| 55 | |||
| 56 | $methods[] = [ |
||
| 57 | 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION, |
||
| 58 | 'type' => ArrayIterator::class, |
||
| 59 | 'format' => $format, |
||
| 60 | 'method' => 'deserializeIterator', |
||
| 61 | ]; |
||
| 62 | } |
||
| 63 | |||
| 64 | foreach (self::SUPPORTED_FORMATS as $format) { |
||
| 65 | $methods[] = [ |
||
| 66 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
||
| 67 | 'type' => Generator::class, |
||
| 68 | 'format' => $format, |
||
| 69 | 'method' => 'serializeIterable', |
||
| 70 | ]; |
||
| 71 | |||
| 72 | $methods[] = [ |
||
| 73 | 'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION, |
||
| 74 | 'type' => Generator::class, |
||
| 75 | 'format' => $format, |
||
| 76 | 'method' => 'deserializeGenerator', |
||
| 77 | ]; |
||
| 78 | } |
||
| 79 | |||
| 80 | return $methods; |
||
| 81 | } |
||
| 134 |
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