Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation notice for Symfony Bridge #185

Merged
merged 1 commit into from
Sep 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix deprecation notice for Symfony Bridge
  • Loading branch information
FabienPapet committed Sep 16, 2017
commit c1bb9bfb9ee7fc6f39fa1f526978e7bbc6db406b
6 changes: 6 additions & 0 deletions src/Bridge/Symfony/CocurSlugifyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;

/**
* CocurSlugifyExtension
Expand Down Expand Up @@ -57,5 +58,10 @@ public function load(array $configs, ContainerBuilder $container)
->addTag('twig.extension')
->setPublic(false);
$container->setAlias('slugify', 'cocur_slugify');

// for symfony versions > 3.3
if (Kernel::VERSION_ID > 30300) {
$container->setAlias('Cocur\Slugify\Slugify', 'cocur_slugify');
}
}
}