Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Generates the router matcher and generator classes.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final since version 3.4, to be given a container instead in 4.0
*/
class RouterCacheWarmer implements CacheWarmerInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TranslationsCacheWarmer implements CacheWarmerInterface
/**
* TranslationsCacheWarmer constructor.
*
* @param ContainerInterface|TranslatorInterface $container
* @param ContainerInterface $container
*/
public function __construct($container)
{
Expand All @@ -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__));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down