Merge branch '4.4'

* 4.4:
  [FrameworkBundle] fix compat with some SF5 components
This commit is contained in:
Nicolas Grekas 2019-06-06 18:29:29 +02:00
commit 6cb9aeac1c
2 changed files with 9 additions and 4 deletions

View File

@ -21,6 +21,7 @@ use Symfony\Component\Validator\Mapping\Loader\LoaderChain;
use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;
use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader;
use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader;
use Symfony\Component\Validator\ValidatorBuilder;
use Symfony\Component\Validator\ValidatorBuilderInterface;
/**
@ -33,10 +34,14 @@ class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
private $validatorBuilder;
/**
* @param string $phpArrayFile The PHP file where metadata are cached
* @param ValidatorBuilder $validatorBuilder
* @param string $phpArrayFile The PHP file where metadata are cached
*/
public function __construct(ValidatorBuilderInterface $validatorBuilder, string $phpArrayFile)
public function __construct($validatorBuilder, string $phpArrayFile)
{
if (!$validatorBuilder instanceof ValidatorBuilder || !$validatorBuilder instanceof ValidatorBuilderInterface) {
throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, ValidatorBuilder::class, \is_object($validatorBuilder) ? \get_class($validatorBuilder) : \gettype($validatorBuilder)));
}
if (2 < \func_num_args() && \func_get_arg(2) instanceof CacheItemPoolInterface) {
@trigger_error(sprintf('The CacheItemPoolInterface $fallbackPool argument of "%s()" is deprecated since Symfony 4.2, you should not pass it anymore.', __METHOD__), E_USER_DEPRECATED);
}

View File

@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\RouteCollectionBuilder;
@ -30,7 +30,7 @@ class ConcreteMicroKernel extends Kernel implements EventSubscriberInterface
private $cacheDir;
public function onKernelException(GetResponseForExceptionEvent $event)
public function onKernelException(RequestEvent $event)
{
if ($event->getException() instanceof Danger) {
$event->setResponse(Response::create('It\'s dangerous to go alone. Take this ⚔'));