| Conditions | 10 |
| Paths | 9 |
| Total Lines | 43 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 declare(strict_types=1); |
||
| 43 | public function processNode(Node $node, Scope $scope): array |
||
| 44 | { |
||
| 45 | if ($this->isInternal($node)) { |
||
| 46 | return []; |
||
| 47 | } |
||
| 48 | |||
| 49 | if ($this->isTestClass($node)) { |
||
| 50 | return ['Test classes must be flagged @internal to not be captured by the BC checker']; |
||
| 51 | } |
||
| 52 | |||
| 53 | if ($this->isStorefrontController($node)) { |
||
| 54 | return ['Storefront controllers must be flagged @internal to not be captured by the BC checker. The BC promise is checked over the route annotation.']; |
||
| 55 | } |
||
| 56 | |||
| 57 | if ($this->isBundle($node)) { |
||
| 58 | return ['Bundles must be flagged @internal to not be captured by the BC checker.']; |
||
| 59 | } |
||
| 60 | |||
| 61 | if ($this->isEventSubscriber($node)) { |
||
| 62 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 63 | /** |
||
| 64 | * @deprecated tag:v6.5.0 - remove deprecation check, as all listener should become internal in v6.5.0 |
||
| 65 | */ |
||
| 66 | if (\str_contains($classDeprecation, 'reason:becomes-internal') || \str_contains($classDeprecation, 'reason:remove-subscriber')) { |
||
| 67 | return []; |
||
| 68 | } |
||
| 69 | |||
| 70 | return ['Event subscribers must be flagged @internal to not be captured by the BC checker.']; |
||
| 71 | } |
||
| 72 | |||
| 73 | if ($namespace = $this->isInInternalNamespace($node)) { |
||
| 74 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 75 | /** |
||
| 76 | * @deprecated tag:v6.5.0 - remove deprecation check, as all classes in internal namespaces should become internal in v6.5.0 |
||
| 77 | */ |
||
| 78 | if (\str_contains($classDeprecation, 'reason:becomes-internal')) { |
||
| 79 | return []; |
||
| 80 | } |
||
| 81 | |||
| 82 | return ['Classes in `' . $namespace . '` namespace must be flagged @internal to not be captured by the BC checker.']; |
||
| 83 | } |
||
| 84 | |||
| 85 | return []; |
||
| 86 | } |
||
| 174 |
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