| Conditions | 2 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function getRouteName(string $resourceClass, $operationType /**, array $context = []**/): string |
||
| 42 | { |
||
| 43 | $context = \func_num_args() > 2 ? func_get_arg(2) : []; |
||
| 44 | $cacheKey = self::CACHE_KEY_PREFIX.md5(serialize([$resourceClass, $operationType, $context['subresource_resources'] ?? null])); |
||
| 45 | |||
| 46 | return $this->getCached($cacheKey, function () use ($resourceClass, $operationType, $context) { |
||
| 47 | return $this->decorated->getRouteName($resourceClass, $operationType, $context); |
||
|
|
|||
| 48 | }); |
||
| 51 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.