Skip to content

Commit

Permalink
Rename listener to matche the exception it handles
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Nov 12, 2019
1 parent e3250ce commit d05634c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class InvalidConfigurationListenerPass implements CompilerPassInterface
final class InvalidRedirectConfigurationListenerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('netgen.ezplatform_site.event_listener.invalid_configuration')) {
if (!$container->hasDefinition('netgen.ezplatform_site.event_listener.invalid_redirect_configuration')) {
return;
}

if ($container->getParameter('kernel.debug') === false) {
return;
}

$container->removeDefinition('netgen.ezplatform_site.event_listener.invalid_configuration');
$container->removeDefinition('netgen.ezplatform_site.event_listener.invalid_redirect_configuration');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

final class InvalidConfigurationListener implements EventSubscriberInterface
final class InvalidRedirectConfigurationListener implements EventSubscriberInterface
{
/**
* @var \Psr\Log\LoggerInterface
Expand Down
4 changes: 2 additions & 2 deletions bundle/NetgenEzPlatformSiteApiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\AggregateRepositoryPass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\DefaultViewActionOverridePass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\InvalidConfigurationListenerPass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\InvalidRedirectConfigurationListenerPass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\PreviewControllerOverridePass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\RelationResolverRegistrationPass;
use Netgen\Bundle\EzPlatformSiteApiBundle\DependencyInjection\Compiler\ViewBuilderRegistrationPass;
Expand All @@ -26,7 +26,7 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new PreviewControllerOverridePass());
$container->addCompilerPass(new RelationResolverRegistrationPass());
$container->addCompilerPass(new ViewBuilderRegistrationPass());
$container->addCompilerPass(new InvalidConfigurationListenerPass());
$container->addCompilerPass(new InvalidRedirectConfigurationListenerPass());

/** @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\EzPublishCoreExtension $coreExtension */
$coreExtension = $container->getExtension('ezpublish');
Expand Down
4 changes: 2 additions & 2 deletions bundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ services:
tags:
- { name: kernel.event_subscriber }

netgen.ezplatform_site.event_listener.invalid_configuration:
class: Netgen\Bundle\EzPlatformSiteApiBundle\EventListener\InvalidConfigurationListener
netgen.ezplatform_site.event_listener.invalid_redirect_configuration:
class: Netgen\Bundle\EzPlatformSiteApiBundle\EventListener\InvalidRedirectConfigurationListener
public: false
arguments:
- '@router'
Expand Down

0 comments on commit d05634c

Please sign in to comment.