| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | final class Situations |
||
| 8 | { |
||
| 9 | private static $methodAliases = []; |
||
| 10 | |||
| 11 | private static $methods = []; |
||
| 12 | |||
| 13 | 115 | public static function add($listenerClass, $situation, $methods): void |
|
| 17 | } |
||
| 18 | 115 | } |
|
| 19 | |||
| 20 | 111 | public static function call($method, $args) |
|
| 21 | { |
||
| 22 | 111 | $method = self::$methodAliases[$method] ?? $method; |
|
| 23 | 111 | $args = is_array($args[0]) ? $args[0] : $args; |
|
| 24 | 111 | [$listenerClass, $situation] = self::$methods[$method]; |
|
| 25 | |||
| 26 | 111 | resolve('heyman.chains')->init( |
|
|
|
|||
| 27 | 111 | $listenerClass, ...resolve($situation)->normalize($method, $args) |
|
| 28 | ); |
||
| 29 | |||
| 30 | 110 | return resolve(YouShouldHave::class); |
|
| 31 | } |
||
| 32 | |||
| 33 | 2 | public static function aliasMethod($currentName, $newName) |
|
| 36 | 2 | } |
|
| 37 | } |
||
| 38 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.