Skip to content

Commit

Permalink
IBX-2: Replaced Router interface with urlGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Mar 8, 2021
1 parent 8d1d1d6 commit 1b4494f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services/views.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ services:
$contentTypeService: '@ezpublish.api.service.content_type'
$siteAccessGroups: '%ezpublish.siteaccess.groups%'
$innerFilter: '@EzSystems\EzPlatformAdminUi\View\Filter\AdminSearchViewFilter.inner'
$router: '@router'
$urlGenerator: '@router'
tags:
- { name: kernel.event_subscriber }
12 changes: 6 additions & 6 deletions src/lib/View/Filter/AdminSearchViewFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class AdminSearchViewFilter implements EventSubscriberInterface
{
Expand All @@ -43,8 +43,8 @@ class AdminSearchViewFilter implements EventSubscriberInterface
/** @var \Ibexa\Platform\Search\View\SearchViewFilter */
private $innerFilter;

/** @var \Symfony\Component\Routing\RouterInterface */
private $router;
/** @var \Symfony\Component\Routing\Generator\UrlGeneratorInterface */
private $urlGenerator;

public function __construct(
ConfigResolverInterface $configResolver,
Expand All @@ -53,15 +53,15 @@ public function __construct(
ContentTypeService $contentTypeService,
array $siteAccessGroups,
SearchViewFilter $innerFilter,
RouterInterface $router
UrlGeneratorInterface $urlGenerator
) {
$this->configResolver = $configResolver;
$this->formFactory = $formFactory;
$this->sectionService = $sectionService;
$this->contentTypeService = $contentTypeService;
$this->siteAccessGroups = $siteAccessGroups;
$this->innerFilter = $innerFilter;
$this->router = $router;
$this->urlGenerator = $urlGenerator;
}

public static function getSubscribedEvents()
Expand Down Expand Up @@ -140,7 +140,7 @@ public function handleSearchForm(FilterViewBuilderParametersEvent $event): void
[
'method' => Request::METHOD_GET,
'csrf_protection' => false,
'action' => $this->router->generate('ezplatform.search'),
'action' => $this->urlGenerator->generate('ezplatform.search'),
]
);

Expand Down

0 comments on commit 1b4494f

Please sign in to comment.