| Total Complexity | 5 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class MethodToCall |
||
| 10 | { |
||
| 11 | private string $className; |
||
| 12 | |||
| 13 | private string $methodName; |
||
| 14 | |||
| 15 | 4 | public function __construct(string $className, string $methodName) |
|
| 16 | { |
||
| 17 | // If the method does not actually exist, we'll also check if __call exists (mainly for |
||
| 18 | // legacy purposes). That said, we won't rewrite the method name to __call because our |
||
| 19 | // static analysis checker might still be able to infer data from the original method name. |
||
| 20 | 4 | if (! method_exists($className, $methodName) && ! method_exists($className, '__call')) { |
|
| 21 | 1 | throw MethodDoesNotExist::on($className, $methodName); |
|
| 22 | } |
||
| 23 | |||
| 24 | 3 | $this->className = $className; |
|
| 25 | 3 | $this->methodName = $methodName; |
|
| 26 | 3 | } |
|
| 27 | |||
| 28 | 3 | public function getClassName(): string |
|
| 31 | } |
||
| 32 | |||
| 33 | 3 | public function getMethodName(): string |
|
| 38 |