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\PagePartBundle\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_pagepart.page_part_configuration_reader.class' => \Kunstmaan\PagePartBundle\PagePartConfigurationReader\PagePartConfigurationReader::class, |
|
17 | 'kunstmaan_pagepart.page_part_configuration_parser.class' => \Kunstmaan\PagePartBundle\PagePartConfigurationReader\PagePartConfigurationParser::class, |
||
18 | 'kunstmaan_pagepart.page_template_configuration_reader.class' => \Kunstmaan\PagePartBundle\PageTemplate\PageTemplateConfigurationReader::class, |
||
19 | 'kunstmaan_pagepart.page_template_configuration_parser.class' => \Kunstmaan\PagePartBundle\PageTemplate\PageTemplateConfigurationParser::class, |
||
20 | 'kunstmaan_page_part.page_template.page_template_configuration_service.class' => \Kunstmaan\PagePartBundle\PageTemplate\PageTemplateConfigurationService::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 KunstmaanPagePartBundle 5.2 and will be removed in KunstmaanPagePartBundle 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: