| Conditions | 4 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function dataProvider($array) |
||
| 12 | { |
||
| 13 | $this->stub = 'multi-select-provider.stub'; |
||
| 14 | |||
| 15 | [$class, $method] = $array; |
||
| 16 | |||
| 17 | if (! class_exists($class)){ |
||
| 18 | throw new Exception("Class {$class} doesn't exist."); |
||
| 19 | } |
||
| 20 | |||
| 21 | $method = $method ?: 'handle'; |
||
| 22 | |||
| 23 | if (! method_exists($class, $method)){ |
||
| 24 | throw new Exception("Method {$method} doesn't exist on {$class} class."); |
||
| 25 | } |
||
| 26 | |||
| 27 | $this->provider = "\\{$class}::{$method}()"; |
||
| 28 | |||
| 29 | return $this; |
||
| 30 | } |
||
| 32 |