| Conditions | 14 |
| Paths | 13 |
| Total Lines | 67 |
| Code Lines | 29 |
| 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 declare(strict_types=1); |
||
| 46 | public function processNode(Node $node, Scope $scope): array |
||
| 47 | { |
||
| 48 | if ($this->isInternal($node)) { |
||
| 49 | return []; |
||
| 50 | } |
||
| 51 | |||
| 52 | if ($this->isTestClass($node)) { |
||
| 53 | return ['Test classes must be flagged @internal to not be captured by the BC checker']; |
||
| 54 | } |
||
| 55 | |||
| 56 | if ($this->isStorefrontController($node)) { |
||
| 57 | return ['Storefront controllers must be flagged @internal to not be captured by the BC checker. The BC promise is checked over the route annotation.']; |
||
| 58 | } |
||
| 59 | |||
| 60 | if ($this->isBundle($node)) { |
||
| 61 | return ['Bundles must be flagged @internal to not be captured by the BC checker.']; |
||
| 62 | } |
||
| 63 | |||
| 64 | if ($this->isEventSubscriber($node)) { |
||
| 65 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 66 | /** |
||
| 67 | * @deprecated tag:v6.5.0 - remove deprecation check, as all listener should become internal in v6.5.0 |
||
| 68 | */ |
||
| 69 | if (\str_contains($classDeprecation, 'reason:becomes-internal') || \str_contains($classDeprecation, 'reason:remove-subscriber')) { |
||
| 70 | return []; |
||
| 71 | } |
||
| 72 | |||
| 73 | return ['Event subscribers must be flagged @internal to not be captured by the BC checker.']; |
||
| 74 | } |
||
| 75 | |||
| 76 | if ($namespace = $this->isInInternalNamespace($node)) { |
||
| 77 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 78 | /** |
||
| 79 | * @deprecated tag:v6.5.0 - remove deprecation check, as all classes in internal namespaces should become internal in v6.5.0 |
||
| 80 | */ |
||
| 81 | if (\str_contains($classDeprecation, 'reason:becomes-internal')) { |
||
| 82 | return []; |
||
| 83 | } |
||
| 84 | |||
| 85 | return ['Classes in `' . $namespace . '` namespace must be flagged @internal to not be captured by the BC checker.']; |
||
| 86 | } |
||
| 87 | |||
| 88 | if ($this->isMigrationStep($node)) { |
||
| 89 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 90 | /** |
||
| 91 | * @deprecated tag:v6.5.0 - remove deprecation check, as all migration steps become internal in v6.5.0 |
||
| 92 | */ |
||
| 93 | if (\str_contains($classDeprecation, 'tag:v6.5.0')) { |
||
| 94 | return []; |
||
| 95 | } |
||
| 96 | |||
| 97 | return ['Migrations must be flagged @internal to not be captured by the BC checker.']; |
||
| 98 | } |
||
| 99 | |||
| 100 | if ($this->isMessageHandler($node)) { |
||
| 101 | $classDeprecation = $node->getClassReflection()->getDeprecatedDescription() ?? ''; |
||
| 102 | /** |
||
| 103 | * @deprecated tag:v6.5.0 - remove deprecation check, as all migration steps become internal in v6.5.0 |
||
| 104 | */ |
||
| 105 | if (\str_contains($classDeprecation, 'tag:v6.5.0')) { |
||
| 106 | return []; |
||
| 107 | } |
||
| 108 | |||
| 109 | return ['MessageHandlers must be flagged @internal to not be captured by the BC checker.']; |
||
| 110 | } |
||
| 111 | |||
| 112 | return []; |
||
| 113 | } |
||
| 230 |
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