Skip to content

Commit 74dc6f2

Browse files
authored
Fix Symfony 4.x deprecation notices (#14)
1 parent 4194657 commit 74dc6f2

File tree

9 files changed

+26
-28
lines changed

9 files changed

+26
-28
lines changed

CHANGELOG.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
Changelog
22
=========
33

4-
Version 1.3
5-
-----------
4+
## Version 2.0
5+
6+
* `\Webfactory\Bundle\LegacyIntegrationBundle\Integration\Filter` now requires `\Symfony\Component\HttpKernel\Event\ControllerEvent` as the event
7+
class for its first argument, following the changed Event class names in Symfony 4.3.
8+
9+
## Version 1.3
610

711
* Symfony sub-requests can be dispatched to the legacy app (but the legacy app is still called at most once per web request)
812

9-
Version 1.2
10-
-----------
13+
## Version 1.2
1114

1215
* Legacy front controllers don't have to return the HTTP status code anymore
1316

14-
Version 1.1
15-
-----------
17+
## Version 1.1
1618

1719
* Added a way to embed Symfony 2 output into the legacy response (#5)
1820
* Fixed that `LegacyApplicationDispatchingEventListener` would not play nicely with `SensioFrameworkExtraBundle`'s `@Cache` annotation (#6)

Controller/PassthruController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
1212
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Annotation as Legacy;
1313

14-
class PassthruController extends Controller
14+
class PassthruController
1515
{
1616
/**
1717
* @Legacy\Dispatch

DependencyInjection/Configuration.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ public function getConfigTreeBuilder()
1717
{
1818
$treeBuilder = new TreeBuilder('webfactory_legacy_integration');
1919

20-
if (method_exists($treeBuilder, 'getRootNode')) {
21-
$rootNode = $treeBuilder->getRootNode();
22-
} else {
23-
// BC layer for symfony/config 4.1 and older
24-
$rootNode = $treeBuilder->root('webfactory_legacy_integration');
25-
}
26-
20+
$rootNode = $treeBuilder->getRootNode();
21+
2722
$rootNode
2823
->children()
2924
->scalarNode('legacyApplicationBootstrapFile')->defaultValue('%project.webdir%/wfD2Engine.php')->end()

EventListener/LegacyApplicationDispatchingEventListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Webfactory\Bundle\LegacyIntegrationBundle\EventListener;
1010

1111
use Doctrine\Common\Annotations\Reader;
12-
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
12+
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1313
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Annotation\Dispatch;
1414
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Filter;
1515
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\LegacyApplication;
@@ -41,7 +41,7 @@ public function addFilter(Filter $filter)
4141
$this->filters[] = $filter;
4242
}
4343

44-
public function onKernelController(FilterControllerEvent $event)
44+
public function onKernelController(ControllerEvent $event)
4545
{
4646
if (!\is_array($controller = $event->getController())) {
4747
return;

Integration/Filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
namespace Webfactory\Bundle\LegacyIntegrationBundle\Integration;
1010

1111
use Symfony\Component\HttpFoundation\Response;
12-
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
12+
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1313

1414
interface Filter
1515
{
16-
public function filter(FilterControllerEvent $event, Response $response);
16+
public function filter(ControllerEvent $event, Response $response);
1717
}

Integration/Filter/KeepCookiesAndHeadersFilter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use Doctrine\Common\Annotations\Reader;
1212
use Symfony\Component\HttpFoundation\Cookie;
1313
use Symfony\Component\HttpFoundation\Response;
14-
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
15-
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
14+
use Symfony\Component\HttpKernel\Event\ControllerEvent;
15+
use Symfony\Component\HttpKernel\Event\ResponseEvent;
1616
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Annotation\KeepCookies;
1717
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Annotation\KeepHeaders;
1818
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Filter as FilterInterface;
@@ -36,7 +36,7 @@ public function __construct(Reader $reader)
3636
$this->reader = $reader;
3737
}
3838

39-
public function filter(FilterControllerEvent $event, Response $response)
39+
public function filter(ControllerEvent $event, Response $response)
4040
{
4141
if (!\is_array($controller = $event->getController())) {
4242
return;
@@ -56,7 +56,7 @@ public function filter(FilterControllerEvent $event, Response $response)
5656
}
5757
}
5858

59-
public function onKernelResponse(FilterResponseEvent $event)
59+
public function onKernelResponse(ResponseEvent $event)
6060
{
6161
if (!$this->legacyResponse) {
6262
return;

Integration/Filter/PassthruLegacyResponseFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Webfactory\Bundle\LegacyIntegrationBundle\Integration\Filter;
1010

1111
use Symfony\Component\HttpFoundation\Response;
12-
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
12+
use Symfony\Component\HttpKernel\Event\ControllerEvent;
1313
use Webfactory\Bundle\LegacyIntegrationBundle\Integration\Filter as FilterInterface;
1414

1515
/**
@@ -21,7 +21,7 @@
2121
*/
2222
class PassthruLegacyResponseFilter implements FilterInterface
2323
{
24-
public function filter(FilterControllerEvent $event, Response $response)
24+
public function filter(ControllerEvent $event, Response $response)
2525
{
2626
if ($this->check($response)) {
2727
$event->setController(function () use ($response) {

Twig/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Webfactory\Bundle\LegacyIntegrationBundle\Twig;
1010

1111
use Psr\Container\ContainerInterface;
12-
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
12+
use Symfony\Contracts\Service\ServiceSubscriberInterface;
1313
use Twig\Extension\AbstractExtension;
1414
use Twig\Extension\GlobalsInterface;
1515
use Twig\TwigFunction;

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
"doctrine/annotations": "~1.0",
2222
"psr/container": "^1.0",
2323
"psr/log": "^1.0",
24-
"symfony/config": "3.4.*|^4.0",
25-
"symfony/dependency-injection": "3.4.*|^4.0",
24+
"symfony/config": "^4.3",
25+
"symfony/dependency-injection": "^4.2",
2626
"symfony/framework-bundle": "3.4.*|^4.0",
2727
"symfony/http-foundation": "3.4.*|^4.0",
28-
"symfony/http-kernel": "3.4.*|^4.0",
28+
"symfony/http-kernel": "^4.3",
29+
"symfony/service-contracts": "^1.0|^2.0",
2930
"twig/twig": "^1.34|^2.0",
3031
"webfactory/dom": "~1.0, >= 1.0.15"
3132
}

0 commit comments

Comments
 (0)