Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.2098 |
Changes | 0 |
1 | <?php |
||
21 | 17 | public function __construct($name) |
|
22 | { |
||
23 | 17 | $this->name = (string)$name; |
|
24 | 17 | if (!class_exists($this->name)) { |
|
25 | throw new \LogicException(sprintf('Class %s does not exist', $name)); |
||
26 | } |
||
27 | 17 | if (!in_array(StaticApiFactoryInterface::class, class_implements($name), true)) { |
|
28 | throw new \LogicException(sprintf('Class %s is not a static factory', $name)); |
||
29 | } |
||
30 | 17 | } |
|
31 | |||
40 |