Skip to content

Commit

Permalink
Limit Symfony to 3.4 and update service definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed May 20, 2018
1 parent 1cdce5a commit 039ef3b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"require": {
"php": ">= 7.1.3",
"symfony/framework-bundle": "^3.0 | ^4.0",
"symfony/http-foundation": "^3.0 | ^4.0"
"symfony/framework-bundle": "^3.4 | ^4.0",
"symfony/http-foundation": "^3.4 | ^4.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace SolidWorx\SimpleResponseBundle\DependencyInjection\CompilerPass;

use SolidWorx\SimpleResponseBundle\ResponseHandler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
Expand All @@ -26,11 +27,11 @@ class ResponseHandlerCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('simple_response_handler.handler')) {
if (!$container->hasDefinition(ResponseHandler::class)) {
return;
}

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

foreach (array_keys($container->findTaggedServiceIds('response_handler.handler')) as $serviceId) {
$definition->addMethodCall('addHandler', [new Reference($serviceId)]);
Expand Down
29 changes: 12 additions & 17 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
services:

simple_response_handler.handler:
class: SolidWorx\SimpleResponseBundle\ResponseHandler
_defaults:
autowire: true
public: false
autoconfigure: true

simple_response_handler.event.listener:
class: SolidWorx\SimpleResponseBundle\ResponseHandlerListener
arguments: ['@simple_response_handler.handler']
tags:
- { name: kernel.event_subscriber }
SolidWorx\SimpleResponseBundle\ResponseHandler: ~

SolidWorx\SimpleResponseBundle\ResponseHandlerListener:
tags: ['kernel.event_subscriber']

# Core handlers
simple_response.handler.template_response:
class: SolidWorx\SimpleResponseBundle\Handler\TemplateResponseHandler
arguments: ['@templating']
tags:
- { name: 'response_handler.handler' }
SolidWorx\SimpleResponseBundle\Handler\TemplateResponseHandler:
tags: ['response_handler.handler']

simple_response.handler.redirect_response:
class: SolidWorx\SimpleResponseBundle\Handler\RouteRedirectHandler
arguments: ['@router']
tags:
- { name: 'response_handler.handler' }
SolidWorx\SimpleResponseBundle\Handler\RouteRedirectHandler:
tags: ['response_handler.handler']

0 comments on commit 039ef3b

Please sign in to comment.