Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 3 | public function createWriter($writerClass) |
|
27 | { |
||
28 | 3 | if (isset($this->writers[$writerClass])) { |
|
29 | 1 | return $this->writers[$writerClass]; |
|
30 | } |
||
31 | |||
32 | 3 | if (!isset(class_implements($writerClass)[WriterInterface::class])) { |
|
33 | 1 | throw new InvalidWriterException(); |
|
34 | } |
||
35 | |||
36 | 2 | $this->addWriter($writerClass); |
|
37 | |||
38 | 2 | return $this->writers[$writerClass]; |
|
39 | } |
||
40 | |||
49 |