1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Kunstmaan\AdminBundle\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
|
4 |
|
public function process(ContainerBuilder $container) |
14
|
|
|
{ |
15
|
|
|
$expectedValues = [ |
16
|
4 |
|
'kunstmaan_admin.consoleexception.class' => \Kunstmaan\AdminBundle\EventListener\ConsoleExceptionListener::class, |
17
|
|
|
'kunstmaan_admin.menubuilder.class' => \Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder::class, |
18
|
|
|
'kunstmaan_admin.admin_panel.class' => \Kunstmaan\AdminBundle\Helper\AdminPanel\AdminPanel::class, |
19
|
|
|
'kunstmaan_admin.login.listener.class' => \Kunstmaan\AdminBundle\EventListener\LoginListener::class, |
20
|
|
|
'kunstmaan_admin.admin_locale.listener.class' => \Kunstmaan\AdminBundle\EventListener\AdminLocaleListener::class, |
21
|
|
|
'kunstmaan_admin.acl.helper.class' => \Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper::class, |
22
|
|
|
'kunstmaan_admin.acl.native.helper.class' => \Kunstmaan\AdminBundle\Helper\Security\Acl\AclNativeHelper::class, |
23
|
|
|
'kunstmaan_admin.security.acl.permission.map.class' => \Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMap::class, |
24
|
|
|
'kunstmaan_admin.clone.listener.class' => \Kunstmaan\AdminBundle\EventListener\CloneListener::class, |
25
|
|
|
'kunstmaan_admin.session_security.class' => \Kunstmaan\AdminBundle\EventListener\SessionSecurityListener::class, |
26
|
|
|
'kunstmaan_admin.password_resetting.listener.class' => \Kunstmaan\AdminBundle\EventListener\PasswordResettingListener::class, |
27
|
|
|
'kunstmaan_admin.password_check.listener.class' => \Kunstmaan\AdminBundle\EventListener\PasswordCheckListener::class, |
28
|
|
|
'kunstmaan_admin.domain_configuration.class' => \Kunstmaan\AdminBundle\Helper\DomainConfiguration::class, |
29
|
|
|
'kunstmaan_admin.validator.password_restrictions.class' => \Kunstmaan\AdminBundle\Validator\Constraints\PasswordRestrictionsValidator::class, |
30
|
|
|
'kunstmaan_admin.adminroute.helper.class' => \Kunstmaan\AdminBundle\Helper\AdminRouteHelper::class, |
31
|
|
|
'kunstmaan_admin.adminroute.twig.class' => \Kunstmaan\AdminBundle\Twig\AdminRouteHelperTwigExtension::class, |
32
|
|
|
'kunstmaan_admin.exception.listener.class' => \Kunstmaan\AdminBundle\EventListener\ExceptionSubscriber::class, |
33
|
|
|
'kunstmaan_admin.toolbar.listener.class' => \Kunstmaan\AdminBundle\EventListener\ToolbarListener::class, |
34
|
|
|
'kunstmaan_admin.toolbar.collector.bundle.class' => \Kunstmaan\AdminBundle\Toolbar\BundleVersionDataCollector::class, |
35
|
|
|
'kunstmaan_admin.toolbar.collector.exception.class' => \Kunstmaan\AdminBundle\Toolbar\ExceptionDataCollector::class, |
36
|
|
|
]; |
37
|
|
|
|
38
|
4 |
|
foreach ($expectedValues as $parameter => $expectedValue) { |
39
|
4 |
|
if (false === $container->hasParameter($parameter)) { |
40
|
1 |
|
continue; |
41
|
|
|
} |
42
|
|
|
|
43
|
4 |
|
$currentValue = $container->getParameter($parameter); |
44
|
4 |
|
if ($currentValue !== $expectedValue) { |
45
|
1 |
|
@trigger_error(sprintf('Using the "%s" parameter to change the class of the service definition is deprecated in KunstmaanAdminBundle 5.2 and will be removed in KunstmaanAdminBundle 6.0. Use service decoration or a service alias instead.', $parameter), E_USER_DEPRECATED); |
|
|
|
|
46
|
|
|
} |
47
|
|
|
} |
48
|
4 |
|
} |
49
|
|
|
} |
50
|
|
|
|
If you suppress an error, we recommend checking for the error condition explicitly: