diff --git a/src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php b/src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php index 4667e196c3..f82b397418 100644 --- a/src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php +++ b/src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php @@ -131,7 +131,10 @@ public function onKernelResponse(ResponseEvent $event) $url = $event->getRequest()->getRequestUri(); $token = $this->tokenStorage->getToken(); - if (null !== $token && method_exists($token, 'getProviderKey')) { + if (null !== $token && method_exists($token, 'getFirewallName')) { + $key = $token->getFirewallName(); + } elseif (null !== $token && method_exists($token, 'getProviderKey')) { + // NEXT_MAJOR remove check when symfony 4.4 support is removed $key = $token->getProviderKey(); } else { $key = $this->adminFirewallName; diff --git a/src/Kunstmaan/FormBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Kunstmaan/FormBundle/Tests/DependencyInjection/ConfigurationTest.php index 0cc800b7a1..4fb5a875b5 100644 --- a/src/Kunstmaan/FormBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Kunstmaan/FormBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -16,12 +16,7 @@ public function testConfiguration() $this->assertInstanceOf(TreeBuilder::class, $tree); - if (method_exists($tree, 'getRootNode')) { - $node = $tree->getRootNode(); - } else { - // BC layer for symfony/config 4.1 and older - $node = $tree->root('kunstmaan_form'); - } + $node = $tree->getRootNode(); $this->assertInstanceOf(ArrayNodeDefinition::class, $node); } } diff --git a/src/Kunstmaan/MultiDomainBundle/EventListener/HostOverrideListener.php b/src/Kunstmaan/MultiDomainBundle/EventListener/HostOverrideListener.php index bc36f28b52..8a0316116c 100644 --- a/src/Kunstmaan/MultiDomainBundle/EventListener/HostOverrideListener.php +++ b/src/Kunstmaan/MultiDomainBundle/EventListener/HostOverrideListener.php @@ -6,16 +6,14 @@ use Kunstmaan\AdminBundle\Helper\AdminRouteHelper; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface; class HostOverrideListener { /** - * @var LegacyTranslatorInterface|TranslatorInterface + * @var TranslatorInterface */ protected $translator; @@ -29,15 +27,8 @@ class HostOverrideListener */ protected $adminRouteHelper; - public function __construct( - /* TranslatorInterface */ $translator, - DomainConfigurationInterface $domainConfiguration, - AdminRouteHelper $adminRouteHelper - ) { - if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) { - throw new \InvalidArgumentException(sprintf('Argument "$translator" passed to "%s" must be of the type "%s" or "%s", "%s" given', __METHOD__, LegacyTranslatorInterface::class, TranslatorInterface::class, get_class($translator))); - } - + public function __construct(TranslatorInterface $translator, DomainConfigurationInterface $domainConfiguration, AdminRouteHelper $adminRouteHelper) + { $this->translator = $translator; $this->domainConfiguration = $domainConfiguration; $this->adminRouteHelper = $adminRouteHelper; diff --git a/src/Kunstmaan/MultiDomainBundle/Tests/EventListener/HostOverrideListenerTest.php b/src/Kunstmaan/MultiDomainBundle/Tests/EventListener/HostOverrideListenerTest.php index 910d333581..070dbba4d9 100644 --- a/src/Kunstmaan/MultiDomainBundle/Tests/EventListener/HostOverrideListenerTest.php +++ b/src/Kunstmaan/MultiDomainBundle/Tests/EventListener/HostOverrideListenerTest.php @@ -12,8 +12,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\KernelInterface; diff --git a/src/Kunstmaan/NodeBundle/Event/SlugSecurityEvent.php b/src/Kunstmaan/NodeBundle/Event/SlugSecurityEvent.php index f9bb5127aa..60c4af301e 100644 --- a/src/Kunstmaan/NodeBundle/Event/SlugSecurityEvent.php +++ b/src/Kunstmaan/NodeBundle/Event/SlugSecurityEvent.php @@ -2,11 +2,11 @@ namespace Kunstmaan\NodeBundle\Event; -use Symfony\Contracts\EventDispatcher\Event; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeBundle\Entity\NodeTranslation; use Symfony\Component\HttpFoundation\Request; +use Symfony\Contracts\EventDispatcher\Event; final class SlugSecurityEvent extends Event { diff --git a/src/Kunstmaan/NodeSearchBundle/Search/AbstractElasticaSearcher.php b/src/Kunstmaan/NodeSearchBundle/Search/AbstractElasticaSearcher.php index cd6bd8de73..2f016ea947 100644 --- a/src/Kunstmaan/NodeSearchBundle/Search/AbstractElasticaSearcher.php +++ b/src/Kunstmaan/NodeSearchBundle/Search/AbstractElasticaSearcher.php @@ -99,10 +99,6 @@ public function getSearchResult() $search = new Search($this->search->getClient()); $search->addIndex($index); - if (method_exists($search, 'getType')) { - $search->addType($index->getType($this->indexType)); - } - return $search->search($this->query); } diff --git a/src/Kunstmaan/SearchBundle/Provider/ElasticaProvider.php b/src/Kunstmaan/SearchBundle/Provider/ElasticaProvider.php index 1ebf24cf1e..e406c94319 100644 --- a/src/Kunstmaan/SearchBundle/Provider/ElasticaProvider.php +++ b/src/Kunstmaan/SearchBundle/Provider/ElasticaProvider.php @@ -67,11 +67,6 @@ public function getIndex($indexName) */ public function createDocument($uid, $document, $indexName = '', $indexType = '') { - if (method_exists(Document::class, 'setType')) { - // @phpstan-ignore-next-line - return new Document($uid, $document, $indexType, $indexName); - } - return new Document($uid, $document, $indexName); } @@ -87,9 +82,6 @@ public function addDocument($indexName, $indexType, $document, $uid) { $doc = $this->createDocument($uid, $document); $index = $this->getClient()->getIndex($indexName); - if (method_exists($index, 'getType')) { - return $index->getType($indexType)->addDocument($doc); - } return $index->addDocument($doc); } @@ -131,12 +123,6 @@ public function deleteDocuments($indexName, $indexType, array $ids) { $index = $this->getIndex($indexName); - if (method_exists($index, 'getType')) { - $type = $index->getType($indexType); - - return $this->getClient()->deleteIds($ids, $index, $type); - } - return $this->getClient()->deleteIds($ids, $index); }