| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 3 | public function createReader($readerClass, WalkerInterface $walker) |
|
| 30 | { |
||
| 31 | 3 | $walkerClassName = get_class($walker); |
|
| 32 | |||
| 33 | 3 | if (isset($this->readers[$readerClass][$walkerClassName])) { |
|
| 34 | 1 | return $this->readers[$readerClass][$walkerClassName]; |
|
| 35 | } |
||
| 36 | |||
| 37 | 3 | if (!isset(class_implements($readerClass)[ReaderInterface::class])) { |
|
| 38 | 1 | throw new InvalidReaderException(); |
|
| 39 | } |
||
| 40 | |||
| 41 | 2 | $this->readers[$readerClass][$walkerClassName] = new $readerClass($walker); |
|
| 42 | |||
| 43 | 2 | return $this->readers[$readerClass][$walkerClassName]; |
|
| 44 | } |
||
| 45 | } |
||
| 46 |