|
4 | 4 |
|
5 | 5 | use Sentry\ClientBuilderInterface;
|
6 | 6 | use Sentry\Options;
|
| 7 | +use Sentry\SentryBundle\Command\SentryTestCommand; |
7 | 8 | use Sentry\SentryBundle\ErrorTypesParser;
|
| 9 | +use Sentry\SentryBundle\EventListener\ConsoleListener; |
8 | 10 | use Sentry\SentryBundle\EventListener\ErrorListener;
|
| 11 | +use Sentry\SentryBundle\EventListener\RequestListener; |
| 12 | +use Sentry\SentryBundle\EventListener\SubRequestListener; |
9 | 13 | use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
10 | 14 | use Symfony\Component\Config\FileLocator;
|
11 | 15 | use Symfony\Component\Console\ConsoleEvents;
|
|
14 | 18 | use Symfony\Component\DependencyInjection\Loader;
|
15 | 19 | use Symfony\Component\DependencyInjection\Reference;
|
16 | 20 | use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
| 21 | +use Symfony\Component\HttpKernel\Kernel; |
17 | 22 |
|
18 | 23 | /**
|
19 | 24 | * This is the class that loads and manages your bundle configuration
|
@@ -44,6 +49,7 @@ public function load(array $configs, ContainerBuilder $container)
|
44 | 49 | }
|
45 | 50 |
|
46 | 51 | $this->tagConsoleErrorListener($container);
|
| 52 | + $this->setLegacyVisibilities($container); |
47 | 53 | }
|
48 | 54 |
|
49 | 55 | private function passConfigurationToOptions(ContainerBuilder $container, array $processedConfiguration): void
|
@@ -147,4 +153,18 @@ private function tagConsoleErrorListener(ContainerBuilder $container): void
|
147 | 153 |
|
148 | 154 | $listener->addTag('kernel.event_listener', $tagAttributes);
|
149 | 155 | }
|
| 156 | + |
| 157 | + /** |
| 158 | + * BC layer for symfony < 3.3, listeners and commands must be public |
| 159 | + */ |
| 160 | + private function setLegacyVisibilities(ContainerBuilder $container): void |
| 161 | + { |
| 162 | + if (Kernel::VERSION_ID < 30300) { |
| 163 | + $container->getDefinition(SentryTestCommand::class)->setPublic(true); |
| 164 | + $container->getDefinition(ConsoleListener::class)->setPublic(true); |
| 165 | + $container->getDefinition(ErrorListener::class)->setPublic(true); |
| 166 | + $container->getDefinition(RequestListener::class)->setPublic(true); |
| 167 | + $container->getDefinition(SubRequestListener::class)->setPublic(true); |
| 168 | + } |
| 169 | + } |
150 | 170 | }
|
0 commit comments