fsi-open /
admin-bundle
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | /** |
||||||
| 4 | * (c) FSi sp. z o.o. <[email protected]> |
||||||
| 5 | * |
||||||
| 6 | * For the full copyright and license information, please view the LICENSE |
||||||
| 7 | * file that was distributed with this source code. |
||||||
| 8 | */ |
||||||
| 9 | |||||||
| 10 | declare(strict_types=1); |
||||||
| 11 | |||||||
| 12 | namespace FSi\Bundle\AdminBundle\Admin\Display\Context\Request; |
||||||
| 13 | |||||||
| 14 | use FSi\Bundle\AdminBundle\Admin\Context\Request\AbstractHandler; |
||||||
| 15 | use FSi\Bundle\AdminBundle\Event\AdminEvent; |
||||||
| 16 | use FSi\Bundle\AdminBundle\Event\DisplayEvent; |
||||||
| 17 | use FSi\Bundle\AdminBundle\Event\DisplayEvents; |
||||||
| 18 | use FSi\Bundle\AdminBundle\Exception\RequestHandlerException; |
||||||
| 19 | use Symfony\Component\HttpFoundation\Request; |
||||||
| 20 | use Symfony\Component\HttpFoundation\Response; |
||||||
| 21 | |||||||
| 22 | class Handler extends AbstractHandler |
||||||
| 23 | { |
||||||
| 24 | /** |
||||||
| 25 | * @param AdminEvent $event |
||||||
| 26 | * @param Request $request |
||||||
| 27 | * @return Response|null |
||||||
| 28 | * @throws RequestHandlerException |
||||||
| 29 | */ |
||||||
| 30 | public function handleRequest(AdminEvent $event, Request $request): ?Response |
||||||
| 31 | { |
||||||
| 32 | if (!$event instanceof DisplayEvent) { |
||||||
| 33 | throw new RequestHandlerException(sprintf('%s requires DisplayEvent', get_class($this))); |
||||||
| 34 | } |
||||||
| 35 | |||||||
| 36 | $this->eventDispatcher->dispatch(DisplayEvents::DISPLAY_PRE_RENDER, $event); |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
The call to
Symfony\Contracts\EventD...erInterface::dispatch() has too many arguments starting with $event.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above. Loading history...
|
|||||||
| 37 | if ($event->hasResponse()) { |
||||||
| 38 | return $event->getResponse(); |
||||||
| 39 | } |
||||||
| 40 | |||||||
| 41 | return null; |
||||||
| 42 | } |
||||||
| 43 | } |
||||||
| 44 |