Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit 96525b6

Browse files
authored
Allow Symfony 5.4; drop support for Symfony 3.4
2 parents 137f4c6 + 839abae commit 96525b6

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

composer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@
1717
"doctrine/annotations": "^1.12",
1818
"doctrine/doctrine-bundle": "^1.12.13|^2.0",
1919
"doctrine/orm": "^2.7.2",
20-
"symfony/config": "^4.4",
21-
"symfony/dependency-injection": "^3.4|^4.4",
22-
"symfony/event-dispatcher": "^3.4|^4.4",
23-
"symfony/http-kernel": "^3.4|^4.4"
20+
"symfony/config": "^4.4|^5.4",
21+
"symfony/dependency-injection": "^4.4|^5.4",
22+
"symfony/event-dispatcher": "^4.4|^5.4",
23+
"symfony/http-kernel": "^4.4|^5.4"
2424
},
2525
"config": {
26-
"sort-packages": true,
27-
"platform": {
28-
"php": "7.2.24"
29-
}
26+
"sort-packages": true
3027
},
3128
"require-dev": {
3229
"dama/doctrine-test-bundle": "^6.5",
3330
"phpunit/phpunit": "^8.5",
34-
"symfony/framework-bundle": "^4.4",
35-
"symfony/yaml": "^3.4"
31+
"symfony/framework-bundle": "^4.4|^5.4",
32+
"symfony/yaml": "^4.4|^5.4"
3633
}
3734
}

src/DependencyInjection/OnRequestDependencyInjector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Doctrine\ORM\EntityManagerInterface;
66
use RuntimeException;
77
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
8-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
8+
use Symfony\Component\HttpKernel\Event\RequestEvent;
99
use Symfony\Component\HttpKernel\KernelEvents;
1010
use Webfactory\VisibilityFilterBundle\Filter\Strategy\FilterStrategy;
1111
use Webfactory\VisibilityFilterBundle\Filter\VisibilityColumnConsideringSQLFilter;
@@ -45,7 +45,7 @@ public static function getSubscribedEvents()
4545
return [KernelEvents::REQUEST => 'setUpFilter'];
4646
}
4747

48-
public function setUpFilter(GetResponseEvent $event): void
48+
public function setUpFilter(RequestEvent $event): void
4949
{
5050
if (!$event->isMasterRequest()) {
5151
return; // filter only needs to be set up once (in the master request), as all sub request share the filter instance with the master request

tests/DependencyInjection/OnRequestDependencyInjectorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
99
use Symfony\Component\HttpFoundation\Request;
1010
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
11+
use Symfony\Component\HttpKernel\Event\RequestEvent;
1112
use Symfony\Component\HttpKernel\HttpKernelInterface;
1213
use Symfony\Component\HttpKernel\KernelEvents;
1314
use Webfactory\VisibilityFilterBundle\Filter\VisibilityColumnConsideringSQLFilter;
@@ -46,8 +47,7 @@ public function setUp(): void
4647
*/
4748
public function enables_filter_on_request(): void
4849
{
49-
// we use the deprecated GetResponseEvent in order to support Symfony 3.4 - this can be changed to RequestEvent when removing 3.4 support
50-
$masterRequestEvent = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
50+
$masterRequestEvent = new RequestEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
5151
$this->eventDispatcher->dispatch($masterRequestEvent, KernelEvents::REQUEST);
5252

5353
static::assertTrue($this->entityManager->getFilters()->isEnabled(VisibilityColumnConsideringSQLFilter::NAME));
@@ -60,7 +60,7 @@ public function injects_dependencies_into_filter(): void
6060
{
6161
$this->entityManager->getConfiguration()->addFilter(VisibilityColumnConsideringSQLFilter::NAME, VisibilityColumnConsideringSQLFilterMock::class);
6262

63-
$masterRequestEvent = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
63+
$masterRequestEvent = new RequestEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
6464
$this->eventDispatcher->dispatch($masterRequestEvent, KernelEvents::REQUEST);
6565

6666
/** @var VisibilityColumnConsideringSQLFilterMock $filterMock */

tests/Filter/VisibilityColumnConsideringSQLFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
88
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
99
use Symfony\Component\HttpFoundation\Request;
10-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
10+
use Symfony\Component\HttpKernel\Event\RequestEvent;
1111
use Symfony\Component\HttpKernel\HttpKernelInterface;
1212
use Symfony\Component\HttpKernel\KernelEvents;
1313
use Webfactory\VisibilityFilterBundle\Tests\Fixtures\EntityWithManyToManyRelationship;
@@ -43,7 +43,7 @@ protected function setUp(): void
4343

4444
// activate filter by simulating a request
4545
$eventDispatcher = static::$container->get(EventDispatcherInterface::class);
46-
$masterRequestEvent = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
46+
$masterRequestEvent = new RequestEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
4747
$eventDispatcher->dispatch($masterRequestEvent, KernelEvents::REQUEST);
4848
}
4949

0 commit comments

Comments
 (0)