Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 12 |
Ratio | 100 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
53 | 2 | View Code Duplication | public function createCssControl($section) |
|
|||
54 | { |
||
55 | 2 | if(!isset($this->config[$section])){ |
|
56 | 1 | throw new \InvalidArgumentException("Section $section not found. Did you set it in config?"); |
|
57 | } |
||
58 | 1 | $control = new CssControl(); |
|
59 | 1 | if(isset($this->config[$section]['css'])){ |
|
60 | 1 | $control->setFiles($this->config[$section]['css']); |
|
61 | 1 | } |
|
62 | 1 | $control->setBasePath($this->basePath); |
|
63 | 1 | return $control; |
|
64 | } |
||
65 | |||
80 | } |
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.