diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php index 256bebebe80b7..a650960c948e2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/RouterCacheWarmer.php @@ -19,6 +19,8 @@ * Generates the router matcher and generator classes. * * @author Fabien Potencier + * + * @final since version 3.4, to be given a container instead in 4.0 */ class RouterCacheWarmer implements CacheWarmerInterface { diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php index 33f94650449fb..8a416a2925650 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php @@ -29,7 +29,7 @@ class TranslationsCacheWarmer implements CacheWarmerInterface /** * TranslationsCacheWarmer constructor. * - * @param ContainerInterface|TranslatorInterface $container + * @param ContainerInterface $container */ public function __construct($container) { @@ -38,8 +38,9 @@ public function __construct($container) $this->container = $container; } elseif ($container instanceof TranslatorInterface) { $this->translator = $container; + @trigger_error(sprintf('Using a "%s" as first argument of %s is deprecated since version 3.4 and will be unsupported in version 4.0. Use a %s instead.', TranslatorInterface::class, __CLASS__, ContainerInterface::class), E_USER_DEPRECATED); } else { - throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface or Symfony\Component\Translation\TranslatorInterface as first argument.', __CLASS__)); + throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface as first argument.', __CLASS__)); } } diff --git a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php index 9a60a92e85375..5d45efc7e2f0c 100644 --- a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php +++ b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php @@ -30,8 +30,8 @@ class TemplateCacheWarmer implements CacheWarmerInterface /** * TemplateCacheWarmer constructor. * - * @param ContainerInterface|Environment $container - * @param \Traversable $iterator + * @param ContainerInterface $container + * @param \Traversable $iterator */ public function __construct($container, \Traversable $iterator) { @@ -40,8 +40,9 @@ public function __construct($container, \Traversable $iterator) $this->container = $container; } elseif ($container instanceof Environment) { $this->twig = $container; + @trigger_error(sprintf('Using a "%s" as first argument of %s is deprecated since version 3.4 and will be unsupported in version 4.0. Use a %s instead.', Environment::class, __CLASS__, Container::class), E_USER_DEPRECATED); } else { - throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface or Environment as first argument.', __CLASS__)); + throw new \InvalidArgumentException(sprintf('%s only accepts instance of Symfony\Component\DependencyInjection\ContainerInterface as first argument.', __CLASS__)); } $this->iterator = $iterator;