From 10f5f0636a2efe2765a7a252d2d85d24cd869bf5 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 25 Dec 2019 14:30:39 +0100 Subject: [PATCH 01/11] Allow sf5 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 15636d9..4065676 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ "require": { "php": "^7.0", "psr/cache": "^1.0", - "symfony/security-bundle": "^3.3 || ^4.0", - "symfony/http-foundation": "^3.3 || ^4.0", - "symfony/framework-bundle": "^3.3 || ^4.0", + "symfony/security-bundle": "^3.3 || ^4.0 || ^5.0", + "symfony/http-foundation": "^3.3 || ^4.0 || ^5.0", + "symfony/framework-bundle": "^3.3 || ^4.0" || ^5.0, "league/fractal": "^0.16.0", - "symfony/validator": "^3.3 || ^4.0" + "symfony/validator": "^3.3 || ^4.0 || ^5.0" }, "require-dev": { "symfony/phpunit-bridge": "^4.0.4", From 14f2cac6a8242a79feca70780be9d442749bcf3f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 25 Dec 2019 14:34:41 +0100 Subject: [PATCH 02/11] typo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4065676..007a94a 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "psr/cache": "^1.0", "symfony/security-bundle": "^3.3 || ^4.0 || ^5.0", "symfony/http-foundation": "^3.3 || ^4.0 || ^5.0", - "symfony/framework-bundle": "^3.3 || ^4.0" || ^5.0, + "symfony/framework-bundle": "^3.3 || ^4.0" || ^5.0", "league/fractal": "^0.16.0", "symfony/validator": "^3.3 || ^4.0 || ^5.0" }, From 58436e01d17ecbc03acdf052b065097f76d2525b Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 25 Dec 2019 14:39:21 +0100 Subject: [PATCH 03/11] Fixed the typo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 007a94a..1bade8e 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "psr/cache": "^1.0", "symfony/security-bundle": "^3.3 || ^4.0 || ^5.0", "symfony/http-foundation": "^3.3 || ^4.0 || ^5.0", - "symfony/framework-bundle": "^3.3 || ^4.0" || ^5.0", + "symfony/framework-bundle": "^3.3 || ^4.0 || ^5.0", "league/fractal": "^0.16.0", "symfony/validator": "^3.3 || ^4.0 || ^5.0" }, From 81c24843236364985ebbd0a766c9306fdc5b5862 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 26 Dec 2019 11:46:35 +0100 Subject: [PATCH 04/11] Update Configuration.php --- DependencyInjection/Configuration.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index adda1c2..43f1121 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -15,8 +15,13 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('happyr_api'); + $treeBuilder = new TreeBuilder('happyr_api'); + // Keep compatibility with symfony/config < 4.2 + if (!method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->root('happyr_api'); + } else { + $rootNode = $treeBuilder->getRootNode(); + } $rootNode ->children() From 2b738672b0940b7a00b1aa9758ea68d707608ac0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 26 Dec 2019 12:31:16 +0100 Subject: [PATCH 05/11] Update services.yml --- Resources/config/services.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 2f112c4..e7c8a9f 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,4 +1,5 @@ services: + Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider: '@happyr_api.wsse.security.authentication.provider' happyr_api.wsse.security.authentication.provider: class: Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider arguments: @@ -9,6 +10,7 @@ services: calls: - ['setLogger', ['@?logger']] + Happyr\ApiBundle\Security\Firewall\WsseListener: '@happyr_api.wsse.security.authentication.listener' happyr_api.wsse.security.authentication.listener: class: Happyr\ApiBundle\Security\Firewall\WsseListener arguments: ["@security.token_storage", "@security.authentication.manager"] @@ -16,6 +18,7 @@ services: calls: - ['setResponseFactory', ['@happyr_api.response_factory']] + Happyr\ApiBundle\Service\ResponseFactory: '@happyr_api.response_factory' happyr_api.response_factory: class: Happyr\ApiBundle\Service\ResponseFactory arguments: ['@happyr_api.fractal'] @@ -30,4 +33,5 @@ services: happyr_api.exception_listener: class: Happyr\ApiBundle\EventListener\ExceptionListener - arguments: ['@happyr_api.response_factory', ~] \ No newline at end of file + arguments: ['@happyr_api.response_factory', ~] + From 8586f01e18c002a44a7d0764710a426b79ae415a Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 12:58:21 +0100 Subject: [PATCH 06/11] SF5 fixes --- DependencyInjection/Security/Factory/WsseFactory.php | 11 +---------- Security/Firewall/DebugListener.php | 10 +++------- Security/Firewall/WsseListener.php | 10 +++------- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/DependencyInjection/Security/Factory/WsseFactory.php b/DependencyInjection/Security/Factory/WsseFactory.php index e6f0ff2..3bee6c0 100644 --- a/DependencyInjection/Security/Factory/WsseFactory.php +++ b/DependencyInjection/Security/Factory/WsseFactory.php @@ -15,16 +15,7 @@ */ class WsseFactory implements SecurityFactoryInterface { - /** - * @param ContainerBuilder $container - * @param int $id - * @param array $config - * @param string $userProvider - * @param string $defaultEntryPoint - * - * @return array - */ - public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint) + public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint) { $providerId = 'security.authentication.provider.wsse.'.$id; $container diff --git a/Security/Firewall/DebugListener.php b/Security/Firewall/DebugListener.php index e381584..191b9fe 100644 --- a/Security/Firewall/DebugListener.php +++ b/Security/Firewall/DebugListener.php @@ -3,16 +3,15 @@ namespace Happyr\ApiBundle\Security\Firewall; use Happyr\ApiBundle\Service\ResponseFactory; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Component\Security\Http\Firewall\ListenerInterface; use Happyr\ApiBundle\Security\Authentication\Token\WsseUserToken; /** * @author Tobias Nyholm */ -class DebugListener implements ListenerInterface +class DebugListener { /** * @var TokenStorageInterface @@ -36,10 +35,7 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM $this->authenticationManager = $authenticationManager; } - /** - * @param GetResponseEvent $event - */ - public function handle(GetResponseEvent $event) + public function __invoke(RequestEvent $event) { $token = new WsseUserToken(); $token->setUser('api_user'); diff --git a/Security/Firewall/WsseListener.php b/Security/Firewall/WsseListener.php index dabc9fa..4ca3719 100644 --- a/Security/Firewall/WsseListener.php +++ b/Security/Firewall/WsseListener.php @@ -3,11 +3,10 @@ namespace Happyr\ApiBundle\Security\Firewall; use Happyr\ApiBundle\Service\ResponseFactory; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; +use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; -use Symfony\Component\Security\Http\Firewall\ListenerInterface; use Happyr\ApiBundle\Security\Authentication\Token\WsseUserToken; /** @@ -17,7 +16,7 @@ * * @author Tobias Nyholm */ -class WsseListener implements ListenerInterface +class WsseListener { /** * @var TokenStorageInterface @@ -52,10 +51,7 @@ public function setResponseFactory(ResponseFactory $responseFactory) $this->responseFactory = $responseFactory; } - /** - * @param GetResponseEvent $event - */ - public function handle(GetResponseEvent $event) + public function __invoke(RequestEvent $event) { $request = $event->getRequest(); From 914f2f83ce0f098435fd944e768ec87f3841790c Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 18:31:14 +0100 Subject: [PATCH 07/11] update listener --- EventListener/ExceptionListener.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/EventListener/ExceptionListener.php b/EventListener/ExceptionListener.php index 7bd9f63..0a36446 100644 --- a/EventListener/ExceptionListener.php +++ b/EventListener/ExceptionListener.php @@ -2,9 +2,8 @@ namespace Happyr\ApiBundle\EventListener; -use Fervo\ValidatedMessage\ValidationFailedException as FervoValaidationFailed; use Happyr\ApiBundle\Service\ResponseFactory; -use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; @@ -41,17 +40,15 @@ public function __construct(ResponseFactory $responseFactory, $pathPrefix) /** * Make sure we print a nice error message to the user when we encounter an exception. - * - * @param GetResponseForExceptionEvent $event */ - public function onKernelException(GetResponseForExceptionEvent $event) + public function onKernelException(ExceptionEvent $event) { // Make sure to match uri before we start to catch exceptions if (!preg_match('|^'.$this->pathPrefix.'.*|sim', $event->getRequest()->getPathInfo())) { return; } - $exception = $event->getException(); + $exception = $event->getThrowable(); if ($exception instanceof AccessDeniedException || $exception instanceof AccessDeniedHttpException) { $response = $this->responseFactory->createForbidden(); } elseif ($exception instanceof AuthenticationException) { @@ -62,7 +59,7 @@ public function onKernelException(GetResponseForExceptionEvent $event) $response = $this->responseFactory->createWithError('Method not allowed', 405, 'GEN-METHOD'); } elseif ($exception instanceof NotFoundHttpException) { $response = $this->responseFactory->createNotFound(); - } elseif ($exception instanceof FervoValaidationFailed || $exception instanceof ValidationFailedException) { + } elseif ($exception instanceof ValidationFailedException) { $response = $this->responseFactory->createValidationFailed($exception->getViolations()); } else { $response = $this->responseFactory->createInternalError(); From a4b6e41c49ce6a799b4e5b0a5aac2f23e070bae1 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 20:18:05 +0100 Subject: [PATCH 08/11] Updated deps --- .travis.yml | 11 +++++------ Changelog.md | 17 ++++++++++++++--- Tests/Functional/BundleInitializationTest.php | 2 +- composer.json | 16 ++++++++-------- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 700ba8a..78676e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,22 +16,21 @@ matrix: # Minimum supported dependencies with the latest and oldest PHP version - php: 7.2 env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors" - - php: 7.0 + - php: 7.3 env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors" # Test the latest stable release - - php: 7.0 - - php: 7.1 - php: 7.2 env: COVERAGE=true PHPUNIT_FLAGS="-v --testsuite main --coverage-text --coverage-clover=build/coverage.xml" + - php: 7.4 - - php: 7.1 + - php: 7.3 env: DEPENDENCIES="dunglas/symfony-lock:^3" - - php: 7.1 + - php: 7.3 env: DEPENDENCIES="dunglas/symfony-lock:^4" # Latest commit to master - - php: 7.2 + - php: 7.3 env: STABILITY="dev" allow_failures: diff --git a/Changelog.md b/Changelog.md index 58bf221..ae9af9e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,17 @@ # Change Log -The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. + +## 0.6.0 + +### Added + +- Support for Symfony 5 + +### Removed + +- Support for Symfony < 4.4 +- Support for PHP < 7.2 ## 0.5.0 @@ -13,7 +24,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ### Added -- Support for PHP 7.0 +- Support for PHP 7.0 ## 0.4.1 @@ -23,7 +34,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ## 0.4.0 -### Added +### Added - Support for Symfony 4 diff --git a/Tests/Functional/BundleInitializationTest.php b/Tests/Functional/BundleInitializationTest.php index 72bba67..6ba18e0 100644 --- a/Tests/Functional/BundleInitializationTest.php +++ b/Tests/Functional/BundleInitializationTest.php @@ -24,7 +24,7 @@ protected function getBundleClass() return HappyrApiBundle::class; } - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->addCompilerPass(new PublicServicePass('|happyr_api.*|')); diff --git a/composer.json b/composer.json index 1bade8e..3773903 100644 --- a/composer.json +++ b/composer.json @@ -10,18 +10,18 @@ } ], "require": { - "php": "^7.0", + "php": "^7.2", "psr/cache": "^1.0", - "symfony/security-bundle": "^3.3 || ^4.0 || ^5.0", - "symfony/http-foundation": "^3.3 || ^4.0 || ^5.0", - "symfony/framework-bundle": "^3.3 || ^4.0 || ^5.0", + "symfony/security-bundle": "^4.4 || ^5.0", + "symfony/http-foundation": "^4.4 || ^5.0", + "symfony/framework-bundle": "^4.4 || ^5.0", "league/fractal": "^0.16.0", - "symfony/validator": "^3.3 || ^4.0 || ^5.0" + "symfony/validator": "^4.4 || ^5.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.0.4", - "matthiasnoback/symfony-dependency-injection-test": "^2.3", - "nyholm/symfony-bundle-test": "^1.3.1", + "symfony/phpunit-bridge": "^5.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.1", + "nyholm/symfony-bundle-test": "^1.6.1", "cache/void-adapter": "^1.0" }, "autoload": { From ffb0a3499e8bd6da4c2d32c480b6d4dbc1c735de Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 20:19:35 +0100 Subject: [PATCH 09/11] Remove legacy code --- DependencyInjection/Configuration.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 43f1121..17f6147 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -16,12 +16,7 @@ class Configuration implements ConfigurationInterface public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('happyr_api'); - // Keep compatibility with symfony/config < 4.2 - if (!method_exists($treeBuilder, 'getRootNode')) { - $rootNode = $treeBuilder->root('happyr_api'); - } else { - $rootNode = $treeBuilder->getRootNode(); - } + $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() From 50f5400c99f2fa2c1b6172ec00ae8fd111ec0bfc Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 20:27:22 +0100 Subject: [PATCH 10/11] Use FQCN --- DependencyInjection/HappyrApiExtension.php | 11 ++-- .../Security/Factory/WsseFactory.php | 6 ++- Resources/config/services.yml | 51 ++++++++----------- Security/Firewall/WsseListener.php | 13 +---- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/DependencyInjection/HappyrApiExtension.php b/DependencyInjection/HappyrApiExtension.php index 013660b..4c8556a 100644 --- a/DependencyInjection/HappyrApiExtension.php +++ b/DependencyInjection/HappyrApiExtension.php @@ -2,9 +2,12 @@ namespace Happyr\ApiBundle\DependencyInjection; +use Happyr\ApiBundle\EventListener\ExceptionListener; use Happyr\ApiBundle\Security\Authentication\Provider\DebugProvider; use Happyr\ApiBundle\Security\Authentication\Provider\DummyProvider; +use Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider; use Happyr\ApiBundle\Security\Firewall\DebugListener; +use Happyr\ApiBundle\Security\Firewall\WsseListener; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; @@ -28,7 +31,7 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('services.yml'); // add the error map to the error handler - $wsseProviderId = 'happyr_api.wsse.security.authentication.provider'; + $wsseProviderId = WsseProvider::class; if (!$config['wsse']['enabled']) { $container->removeDefinition($wsseProviderId); $container->register($wsseProviderId, DummyProvider::class) @@ -38,7 +41,7 @@ public function load(array $configs, ContainerBuilder $container) $container->register($wsseProviderId, DebugProvider::class) ->addArgument(null) ->addMethodCall('setDebugRoles', [empty($config['wsse']['debug_roles']) ? ['ROLE_USER', 'ROLE_API_USER'] : $config['wsse']['debug_roles']]); - $container->getDefinition('happyr_api.wsse.security.authentication.listener') + $container->getDefinition(WsseListener::class) ->setClass(DebugListener::class); } else { $definition = $container->getDefinition($wsseProviderId); @@ -50,7 +53,7 @@ public function load(array $configs, ContainerBuilder $container) if ($config['exception_listener']['enabled']) { $this->enabledExceptionHandler($container, $config); } else { - $container->removeDefinition('happyr_api.exception_listener'); + $container->removeDefinition(ExceptionListener::class); } } @@ -62,7 +65,7 @@ public function load(array $configs, ContainerBuilder $container) */ private function enabledExceptionHandler(ContainerBuilder $container, $config) { - $def = $container->getDefinition('happyr_api.exception_listener'); + $def = $container->getDefinition(ExceptionListener::class); $def->replaceArgument(1, $config['exception_listener']['path_prefix']); if ('dev' !== $container->getParameter('kernel.environment')) { $def->addTag( diff --git a/DependencyInjection/Security/Factory/WsseFactory.php b/DependencyInjection/Security/Factory/WsseFactory.php index 3bee6c0..352cbe7 100644 --- a/DependencyInjection/Security/Factory/WsseFactory.php +++ b/DependencyInjection/Security/Factory/WsseFactory.php @@ -2,6 +2,8 @@ namespace Happyr\ApiBundle\DependencyInjection\Security\Factory; +use Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider; +use Happyr\ApiBundle\Security\Firewall\WsseListener; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; @@ -19,12 +21,12 @@ public function create(ContainerBuilder $container, string $id, array $config, s { $providerId = 'security.authentication.provider.wsse.'.$id; $container - ->setDefinition($providerId, new ChildDefinition('happyr_api.wsse.security.authentication.provider')) + ->setDefinition($providerId, new ChildDefinition(WsseProvider::class)) ->replaceArgument(0, new Reference($userProvider)) ; $listenerId = 'security.authentication.listener.wsse.'.$id; - $container->setDefinition($listenerId, new ChildDefinition('happyr_api.wsse.security.authentication.listener')); + $container->setDefinition($listenerId, new ChildDefinition(WsseListener::class)); return [$providerId, $listenerId, $defaultEntryPoint]; } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index e7c8a9f..95d290e 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,37 +1,26 @@ services: - Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider: '@happyr_api.wsse.security.authentication.provider' - happyr_api.wsse.security.authentication.provider: - class: Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider - arguments: - - ~ - - ~ - - ~ - public: false - calls: - - ['setLogger', ['@?logger']] + Happyr\ApiBundle\Security\Authentication\Provider\WsseProvider: + arguments: + - ~ + - ~ + - ~ + public: false + calls: + - ['setLogger', ['@?logger']] - Happyr\ApiBundle\Security\Firewall\WsseListener: '@happyr_api.wsse.security.authentication.listener' - happyr_api.wsse.security.authentication.listener: - class: Happyr\ApiBundle\Security\Firewall\WsseListener - arguments: ["@security.token_storage", "@security.authentication.manager"] - public: false - calls: - - ['setResponseFactory', ['@happyr_api.response_factory']] + Happyr\ApiBundle\Security\Firewall\WsseListener: + arguments: ['@security.token_storage', '@security.authentication.manager', '@Happyr\ApiBundle\Service\ResponseFactory'] - Happyr\ApiBundle\Service\ResponseFactory: '@happyr_api.response_factory' - happyr_api.response_factory: - class: Happyr\ApiBundle\Service\ResponseFactory - arguments: ['@happyr_api.fractal'] + Happyr\ApiBundle\Service\ResponseFactory: + arguments: ['@happyr_api.fractal'] - happyr_api.fractal: - class: League\Fractal\Manager - calls: - - [setSerializer, ['@happyr_api.fractal.serializer']] + happyr_api.fractal: + class: League\Fractal\Manager + calls: + - [setSerializer, ['@happyr_api.fractal.serializer']] - happyr_api.fractal.serializer: - class: League\Fractal\Serializer\DataArraySerializer - - happyr_api.exception_listener: - class: Happyr\ApiBundle\EventListener\ExceptionListener - arguments: ['@happyr_api.response_factory', ~] + happyr_api.fractal.serializer: + class: League\Fractal\Serializer\DataArraySerializer + Happyr\ApiBundle\EventListener\ExceptionListener: + arguments: ['@Happyr\ApiBundle\Service\ResponseFactory', ~] diff --git a/Security/Firewall/WsseListener.php b/Security/Firewall/WsseListener.php index 4ca3719..b148cf9 100644 --- a/Security/Firewall/WsseListener.php +++ b/Security/Firewall/WsseListener.php @@ -33,21 +33,10 @@ class WsseListener */ private $responseFactory; - /** - * @param TokenStorageInterface $tokenStorage - * @param AuthenticationManagerInterface $authenticationManager - */ - public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager) + public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, ResponseFactory $responseFactory) { $this->tokenStorage = $tokenStorage; $this->authenticationManager = $authenticationManager; - } - - /** - * @param ResponseFactory $responseFactory - **/ - public function setResponseFactory(ResponseFactory $responseFactory) - { $this->responseFactory = $responseFactory; } From 1bb578959c04f87673cb3f34531d90aa0ed532fa Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 26 Dec 2019 20:41:30 +0100 Subject: [PATCH 11/11] Travis config --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78676e0..ce64f70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,12 +22,10 @@ matrix: # Test the latest stable release - php: 7.2 env: COVERAGE=true PHPUNIT_FLAGS="-v --testsuite main --coverage-text --coverage-clover=build/coverage.xml" - - php: 7.4 - - php: 7.3 - env: DEPENDENCIES="dunglas/symfony-lock:^3" - php: 7.3 env: DEPENDENCIES="dunglas/symfony-lock:^4" + - php: 7.4 # Latest commit to master - php: 7.3