| Conditions | 3 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3.3332 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 1 | public function getGenerator(string $id): GeneratorInterface |
|
| 28 | { |
||
| 29 | 1 | if (isset($this->instances[$id])) { |
|
| 30 | return $this->instances[$id]; |
||
| 31 | } |
||
| 32 | 1 | return isset($this->proxies[$id]) |
|
| 33 | ? $this->proxies[$id]->loadGenerator() |
||
| 34 | 1 | : throw new GeneratorNotFoundException('Generator "' . $id . '" not found'); |
|
| 35 | } |
||
| 45 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: