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 Kunstmaan\MenuBundle\DependencyInjection\Compiler; |
||
4 | |||
5 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
||
6 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
7 | |||
8 | /** |
||
9 | * @internal |
||
10 | */ |
||
11 | View Code Duplication | final class DeprecateClassParametersPass implements CompilerPassInterface |
|
12 | { |
||
13 | 2 | public function process(ContainerBuilder $container) |
|
14 | { |
||
15 | $expectedValues = [ |
||
16 | 2 | 'kunstmaan_menu.menu.adaptor.class' => \Kunstmaan\MenuBundle\Service\MenuAdaptor::class, |
|
17 | 'kunstmaan_menu.menu.service.class' => \Kunstmaan\MenuBundle\Service\MenuService::class, |
||
18 | 'kunstmaan_menu.menu.twig.extension.class' => \Kunstmaan\MenuBundle\Twig\MenuTwigExtension::class, |
||
19 | 'kunstmaan_menu.menu.repository.class' => \Kunstmaan\MenuBundle\Repository\MenuItemRepository::class, |
||
20 | 'kunstmaan_menu.menu.render_service.class' => \Kunstmaan\MenuBundle\Service\RenderService::class, |
||
21 | ]; |
||
22 | |||
23 | 2 | foreach ($expectedValues as $parameter => $expectedValue) { |
|
24 | 2 | if (false === $container->hasParameter($parameter)) { |
|
25 | 2 | continue; |
|
26 | } |
||
27 | |||
28 | 1 | $currentValue = $container->getParameter($parameter); |
|
29 | 1 | if ($currentValue !== $expectedValue) { |
|
30 | 1 | @trigger_error(sprintf('Using the "%s" parameter to change the class of the service definition is deprecated in KunstmaanMenuBundle 5.2 and will be removed in KunstmaanMenuBundle 6.0. Use service decoration or a service alias instead.', $parameter), E_USER_DEPRECATED); |
|
0 ignored issues
–
show
|
|||
31 | } |
||
32 | } |
||
33 | 2 | } |
|
34 | } |
||
35 |
If you suppress an error, we recommend checking for the error condition explicitly: