| Total Lines | 142 |
| Code Lines | 77 |
| 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 |
||
| 35 | return static function (ContainerConfigurator $containerConfigurator): void { |
||
| 36 | $imports = [ |
||
| 37 | '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/psr12.php', |
||
| 38 | '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/clean-code.php', |
||
| 39 | '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/common.php', |
||
| 40 | '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/symfony.php', |
||
| 41 | '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/symfony-risky.php', |
||
| 42 | ]; |
||
| 43 | |||
| 44 | array_map( |
||
| 45 | [$containerConfigurator, 'import'], |
||
| 46 | array_map(static fn (string $path): string => __DIR__ . $path, $imports) |
||
| 47 | ); |
||
| 48 | |||
| 49 | $services = $containerConfigurator->services(); |
||
| 50 | |||
| 51 | $services |
||
| 52 | ->set(IncrementStyleFixer::class) |
||
| 53 | ->call( |
||
| 54 | 'configure', |
||
| 55 | [ |
||
| 56 | [ |
||
| 57 | 'style' => 'post', |
||
| 58 | ], |
||
| 59 | ], |
||
| 60 | ); |
||
| 61 | |||
| 62 | $services |
||
| 63 | ->set(YodaStyleFixer::class) |
||
| 64 | ->call( |
||
| 65 | 'configure', |
||
| 66 | [ |
||
| 67 | [ |
||
| 68 | 'equal' => false, |
||
| 69 | 'identical' => false, |
||
| 70 | 'less_and_greater' => false, |
||
| 71 | ], |
||
| 72 | ], |
||
| 73 | ); |
||
| 74 | |||
| 75 | $services |
||
| 76 | ->set(ConcatSpaceFixer::class) |
||
| 77 | ->call( |
||
| 78 | 'configure', |
||
| 79 | [ |
||
| 80 | [ |
||
| 81 | 'spacing' => 'one', |
||
| 82 | ], |
||
| 83 | ], |
||
| 84 | ); |
||
| 85 | |||
| 86 | $services |
||
| 87 | ->set(CastSpacesFixer::class) |
||
| 88 | ->call( |
||
| 89 | 'configure', |
||
| 90 | [ |
||
| 91 | [ |
||
| 92 | 'space' => 'none', |
||
| 93 | ], |
||
| 94 | ], |
||
| 95 | ); |
||
| 96 | |||
| 97 | $services |
||
| 98 | ->set(OrderedImportsFixer::class) |
||
| 99 | ->call( |
||
| 100 | 'configure', |
||
| 101 | [ |
||
| 102 | [ |
||
| 103 | 'imports_order' => ['class', 'function', 'const'], |
||
| 104 | ], |
||
| 105 | ], |
||
| 106 | ); |
||
| 107 | |||
| 108 | $services |
||
| 109 | ->set(NoSuperfluousPhpdocTagsFixer::class) |
||
| 110 | ->call( |
||
| 111 | 'configure', |
||
| 112 | [ |
||
| 113 | [ |
||
| 114 | 'remove_inheritdoc' => false, |
||
| 115 | 'allow_mixed' => true, |
||
| 116 | 'allow_unused_params' => false, |
||
| 117 | ], |
||
| 118 | ], |
||
| 119 | ); |
||
| 120 | |||
| 121 | $services |
||
| 122 | ->set(DeclareEqualNormalizeFixer::class) |
||
| 123 | ->call( |
||
| 124 | 'configure', |
||
| 125 | [ |
||
| 126 | [ |
||
| 127 | 'space' => 'single', |
||
| 128 | ], |
||
| 129 | ], |
||
| 130 | ); |
||
| 131 | |||
| 132 | $services |
||
| 133 | ->set(BlankLineBeforeStatementFixer::class) |
||
| 134 | ->call( |
||
| 135 | 'configure', |
||
| 136 | [ |
||
| 137 | [ |
||
| 138 | 'statements' => ['continue', 'declare', 'return', 'throw', 'try'], |
||
| 139 | ], |
||
| 140 | ], |
||
| 141 | ); |
||
| 142 | |||
| 143 | $services |
||
| 144 | ->set(BinaryOperatorSpacesFixer::class) |
||
| 145 | ->call( |
||
| 146 | 'configure', |
||
| 147 | [ |
||
| 148 | [ |
||
| 149 | 'operators' => [ |
||
| 150 | '&' => 'align', |
||
| 151 | ], |
||
| 152 | ], |
||
| 153 | ], |
||
| 154 | ); |
||
| 155 | |||
| 156 | $parameters = $containerConfigurator->parameters(); |
||
| 157 | |||
| 158 | $parameters->set( |
||
| 159 | 'skip', |
||
| 160 | [ |
||
| 161 | NoMultilineWhitespaceAroundDoubleArrowFixer::class => null, |
||
| 162 | PhpdocNoPackageFixer::class => null, |
||
| 163 | PhpdocSummaryFixer::class => null, |
||
| 164 | PhpdocSeparationFixer::class => null, |
||
| 165 | BlankLineAfterOpeningTagFixer::class => null, |
||
| 166 | ClassAttributesSeparationFixer::class => null, |
||
| 167 | NoBlankLinesBeforeNamespaceFixer::class => null, |
||
| 168 | NotOperatorWithSuccessorSpaceFixer::class => null, |
||
| 169 | SingleLineThrowFixer::class => null, |
||
| 170 | PhpdocAlignFixer::class => null, |
||
| 171 | PhpdocToCommentFixer::class => null, |
||
| 172 | NativeFunctionInvocationFixer::class => null, |
||
| 173 | ] |
||
| 174 | ); |
||
| 175 | |||
| 176 | $parameters->set(Option::PARALLEL, true); |
||
| 177 | }; |
||
| 178 |
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