Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
9 | 5 | public function validate($instance) |
|
10 | { |
||
11 | 5 | if (is_callable($instance)) { |
|
12 | 5 | return; |
|
13 | } |
||
14 | |||
15 | 1 | throw new InvalidServiceException(sprintf( |
|
16 | 1 | 'Only callables are valid plugins for "%s". "%s" provided', |
|
17 | 1 | __CLASS__, |
|
18 | 1 | is_object($instance) ? get_class($instance) : gettype($instance) |
|
19 | 1 | )); |
|
20 | } |
||
21 | } |
||
22 |