minor #31907 [FrameworkBundle] fix compat with some SF5 components (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] fix compat with some SF5 components
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
92aa6eed97
[FrameworkBundle] fix compat with some SF5 components
This commit is contained in:
commit
1093a5e0e2
@ -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);
|
||||
}
|
||||
|
@ -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 ⚔'));
|
||||
|
Reference in New Issue
Block a user