| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | protected static function getWantedType(string $fieldName): TypeUtilInterface |
||
| 20 | { |
||
| 21 | if (!preg_match('#^([a-z-]+|\*)/([a-z-]+|\*)$#', $fieldName)) { |
||
| 22 | throw new InvalidKeyException($fieldName); |
||
|
|
|||
| 23 | } |
||
| 24 | return new Compound( |
||
| 25 | $fieldName, |
||
| 26 | new AnotherValueObject($fieldName, MediaType::class), |
||
| 27 | new StringLiteral($fieldName) |
||
| 28 | ); |
||
| 31 |
This check compares calls to functions or methods with their respective definitions. If the call has less 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.