These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Rj\FrontendBundle\DependencyInjection\Compiler\Packages; |
||
4 | |||
5 | View Code Duplication | class AssetCompilerPass extends BasePackagesCompilerPass |
|
0 ignored issues
–
show
|
|||
6 | { |
||
7 | 19 | protected function getTaggedPackages($container) |
|
8 | { |
||
9 | 19 | return $container->findTaggedServiceIds($this->namespaceService('package.asset')); |
|
10 | } |
||
11 | |||
12 | 20 | protected function getPackagesService($container) |
|
13 | { |
||
14 | 20 | if (!$container->hasDefinition('assets.packages')) { |
|
15 | 1 | throw new \LogicException('The Asset component is not registered in the container'); |
|
16 | } |
||
17 | |||
18 | 19 | return $container->getDefinition('assets.packages'); |
|
19 | } |
||
20 | } |
||
21 |
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.