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 | final class DeprecateClassParametersPass implements CompilerPassInterface |
||
12 | { |
||
13 | 2 | public function process(ContainerBuilder $container) |
|
14 | { |
||
15 | $expectedValues = [ |
||
16 | 2 | 'kunstmaan_adminlist.service.export.class' => \Kunstmaan\AdminListBundle\Service\ExportService::class, |
|
17 | ]; |
||
18 | |||
19 | 2 | foreach ($expectedValues as $parameter => $expectedValue) { |
|
20 | 2 | if (false === $container->hasParameter($parameter)) { |
|
21 | 1 | continue; |
|
22 | } |
||
23 | |||
24 | 1 | $currentValue = $container->getParameter($parameter); |
|
25 | 1 | if ($currentValue !== $expectedValue) { |
|
26 | 1 | @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 | 2 | } |
|
30 | } |
||
31 |
If you suppress an error, we recommend checking for the error condition explicitly: