| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 3 | public function __construct(\ReflectionMethod $method, string $required_class = '') |
|
| 19 | { |
||
| 20 | 3 | parent::__construct($method); |
|
| 21 | |||
| 22 | 3 | if ('' !== $required_class && !is_a($method->class, $required_class, true)) { |
|
| 23 | 1 | $this->exception->addError('The @function defined in the class that not inherits "@requiredClass".', [ |
|
| 24 | 1 | '@requiredClass' => $required_class, |
|
| 25 | ]); |
||
| 26 | } |
||
| 27 | 3 | } |
|
| 28 | } |
||
| 29 |