Skip to content

Commit 039ef3b

Browse files
committed
Limit Symfony to 3.4 and update service definitions
1 parent 1cdce5a commit 039ef3b

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
},
1010
"require": {
1111
"php": ">= 7.1.3",
12-
"symfony/framework-bundle": "^3.0 | ^4.0",
13-
"symfony/http-foundation": "^3.0 | ^4.0"
12+
"symfony/framework-bundle": "^3.4 | ^4.0",
13+
"symfony/http-foundation": "^3.4 | ^4.0"
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^7.0"

src/DependencyInjection/CompilerPass/ResponseHandlerCompilerPass.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace SolidWorx\SimpleResponseBundle\DependencyInjection\CompilerPass;
1313

14+
use SolidWorx\SimpleResponseBundle\ResponseHandler;
1415
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
@@ -26,11 +27,11 @@ class ResponseHandlerCompilerPass implements CompilerPassInterface
2627
*/
2728
public function process(ContainerBuilder $container)
2829
{
29-
if (!$container->hasDefinition('simple_response_handler.handler')) {
30+
if (!$container->hasDefinition(ResponseHandler::class)) {
3031
return;
3132
}
3233

33-
$definition = $container->getDefinition('simple_response_handler.handler');
34+
$definition = $container->getDefinition(ResponseHandler::class);
3435

3536
foreach (array_keys($container->findTaggedServiceIds('response_handler.handler')) as $serviceId) {
3637
$definition->addMethodCall('addHandler', [new Reference($serviceId)]);

src/Resources/config/services.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
services:
22

3-
simple_response_handler.handler:
4-
class: SolidWorx\SimpleResponseBundle\ResponseHandler
3+
_defaults:
4+
autowire: true
5+
public: false
6+
autoconfigure: true
57

6-
simple_response_handler.event.listener:
7-
class: SolidWorx\SimpleResponseBundle\ResponseHandlerListener
8-
arguments: ['@simple_response_handler.handler']
9-
tags:
10-
- { name: kernel.event_subscriber }
8+
SolidWorx\SimpleResponseBundle\ResponseHandler: ~
9+
10+
SolidWorx\SimpleResponseBundle\ResponseHandlerListener:
11+
tags: ['kernel.event_subscriber']
1112

1213
# Core handlers
13-
simple_response.handler.template_response:
14-
class: SolidWorx\SimpleResponseBundle\Handler\TemplateResponseHandler
15-
arguments: ['@templating']
16-
tags:
17-
- { name: 'response_handler.handler' }
14+
SolidWorx\SimpleResponseBundle\Handler\TemplateResponseHandler:
15+
tags: ['response_handler.handler']
1816

19-
simple_response.handler.redirect_response:
20-
class: SolidWorx\SimpleResponseBundle\Handler\RouteRedirectHandler
21-
arguments: ['@router']
22-
tags:
23-
- { name: 'response_handler.handler' }
17+
SolidWorx\SimpleResponseBundle\Handler\RouteRedirectHandler:
18+
tags: ['response_handler.handler']

0 commit comments

Comments
 (0)