| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | trait SplEnumTrait |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Return a new instance of enum |
||
| 25 | * |
||
| 26 | * @param string $name |
||
| 27 | * @param mixed[] $arguments |
||
| 28 | * |
||
| 29 | * @return static |
||
| 30 | * |
||
| 31 | * @throws \Error if $name is not a case |
||
| 32 | * |
||
| 33 | * @phpstan-param string $name |
||
| 34 | * @phpstan-param list<mixed> $arguments |
||
| 35 | * @phpstan-return static |
||
| 36 | * @phpstan-ignore-next-line |
||
| 37 | * |
||
| 38 | * @psalm-suppress UnsafeInstantiation |
||
| 39 | */ |
||
| 40 | #[\ReturnTypeWillChange] |
||
| 53 |
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.