| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function validate($instance) |
||
| 45 | { |
||
| 46 | if ($instance instanceof $this->instanceOf) { |
||
| 47 | // we're okay |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | throw new Exception\RuntimeException(sprintf( |
||
| 52 | 'Plugin of type %s is invalid; must implement %s\IdGeneratorInterface', |
||
| 53 | (is_object($instance) ? get_class($instance) : gettype($instance)), |
||
| 54 | __NAMESPACE__ |
||
| 55 | )); |
||
| 56 | } |
||
| 57 | |||
| 66 |