Check that errors are not suppressed
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\TranslatorBundle\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 | 5 | public function process(ContainerBuilder $container) |
|
14 | { |
||
15 | $expectedValues = [ |
||
16 | 5 | 'kunstmaan_translator.menu.adaptor.class' => \Kunstmaan\TranslatorBundle\Service\Menu\TranslatorMenuAdaptor::class, |
|
17 | 'kunstmaan_translator.service.exporter.csv.class' => \Kunstmaan\TranslatorBundle\Service\Command\Exporter\CSVFileExporter::class, |
||
18 | 'kunstmaan_translator.toolbar.collector.translator.class' => \Kunstmaan\TranslatorBundle\Toolbar\TranslatorDataCollector::class, |
||
19 | ]; |
||
20 | |||
21 | 5 | foreach ($expectedValues as $parameter => $expectedValue) { |
|
22 | 5 | if (false === $container->hasParameter($parameter)) { |
|
23 | 2 | continue; |
|
24 | } |
||
25 | |||
26 | 4 | $currentValue = $container->getParameter($parameter); |
|
27 | 4 | if ($currentValue !== $expectedValue) { |
|
28 | 1 | @trigger_error(sprintf('Using the "%s" parameter to change the class of the service definition is deprecated in KunstmaanTranslatorBundle 5.2 and will be removed in KunstmaanTranslatorBundle 6.0. Use service decoration or a service alias instead.', $parameter), E_USER_DEPRECATED); |
|
0 ignored issues
–
show
|
|||
29 | } |
||
30 | } |
||
31 | 5 | } |
|
32 | } |
||
33 |
If you suppress an error, we recommend checking for the error condition explicitly: