Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 13 |
Ratio | 100 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 1 | public function buildRenderer(RendererInterface $renderer, ParserInterface $parser) |
|
38 | { |
||
39 | 1 | $renderer = parent::buildRenderer($renderer, $parser); |
|
40 | |||
41 | 1 | $graphicResolver = $this->getGraphicResolver(); |
|
42 | 1 | if (!$graphicResolver) { |
|
43 | throw new RuntimeException('Graphic resolver not set'); |
||
44 | } |
||
45 | |||
46 | 1 | $renderer->setGraphicResolver($graphicResolver); |
|
47 | |||
48 | 1 | return $renderer; |
|
49 | } |
||
50 | } |
||
51 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.