Skip to content

Commit 1fcf74d

Browse files
authored
Merge pull request #21 from nightlinus/fix/remove_deprecation_notices_for_sf_5
Fix deprecation notices for single colon routes definitions
2 parents 7ef5572 + 2a68e28 commit 1fcf74d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/MetricBundle/DependencyInjection/LamodaMetricExtension.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\DependencyInjection\Definition;
1515
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
1616
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;
17+
use Symfony\Component\HttpKernel\Kernel;
1718

1819
final class LamodaMetricExtension extends ConfigurableExtension
1920
{
@@ -79,6 +80,10 @@ private function processSources(ContainerBuilder $container, array $sources): vo
7980
private function processResponders(ContainerBuilder $container, array $config): void
8081
{
8182
$routerLoader = $container->getDefinition('lamoda_metrics.route_loader');
83+
$separator = ':';
84+
if (Kernel::VERSION_ID >= 40100) {
85+
$separator = '::';
86+
}
8287

8388
foreach ($config as $name => $responderConfig) {
8489
if (!$responderConfig['enabled']) {
@@ -102,7 +107,8 @@ private function processResponders(ContainerBuilder $container, array $config):
102107
$controller->setArguments([$psrController]);
103108

104109
$path = $responderConfig['path'] ?? '/' . $name;
105-
$routerLoader->addMethodCall('registerController', [$name, $path, $controllerId . ':createResponse']);
110+
111+
$routerLoader->addMethodCall('registerController', [$name, $path, $controllerId . $separator . 'createResponse']);
106112
}
107113
}
108114
}

0 commit comments

Comments
 (0)