Skip to content

Commit

Permalink
Ensures isMainRequest method is available before call is made to allo…
Browse files Browse the repository at this point in the history
…w deprecated isMasterRequest method to be called for Symfony 4
  • Loading branch information
Ben Upex committed Aug 3, 2021
1 parent c3c59c6 commit b6676cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Validator/DataCollectingValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public function inContext(ExecutionContextInterface $context): ContextualValidat

public function onKernelRequest(GetResponseEvent $event): void
{
if ($event->isMainRequest()) {
if (method_exists($event, 'isMainRequest') && $event->isMainRequest()) {
$this->clearLastErrors();
} elseif ($event->isMasterRequest()) {
$this->clearLastErrors();
}
}
Expand Down

0 comments on commit b6676cc

Please sign in to comment.