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\AdminListBundle\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 | public function process(ContainerBuilder $container) |
||
14 | { |
||
15 | $expectedValues = [ |
||
16 | 'kunstmaan_adminlist.service.export.class' => \Kunstmaan\AdminListBundle\Service\ExportService::class, |
||
17 | ]; |
||
18 | |||
19 | foreach ($expectedValues as $parameter => $expectedValue) { |
||
20 | if (false === $container->hasParameter($parameter)) { |
||
21 | continue; |
||
22 | } |
||
23 | |||
24 | $currentValue = $container->getParameter($parameter); |
||
25 | if ($currentValue !== $expectedValue) { |
||
26 | @trigger_error(sprintf('Using the "%s" parameter to change the class of the service definition is deprecated in KunstmaanAdminListBundle 5.2 and will be removed in KunstmaanAdminListBundle 6.0. Use service decoration or a service alias instead.', $parameter), E_USER_DEPRECATED); |
||
0 ignored issues
–
show
|
|||
27 | } |
||
28 | } |
||
29 | } |
||
30 | } |
||
31 |
If you suppress an error, we recommend checking for the error condition explicitly: