From e7356924d61d3fb8c4fb18e72c52a0f196bbafab Mon Sep 17 00:00:00 2001 From: Edouard Durieux Date: Mon, 14 Feb 2022 16:50:55 +0100 Subject: [PATCH] Drop support for SF <3.3 and PHP < 7.1, add support for SF4 (#7) * Drop support for SF <3.3 and PHP < 7.1 --- .github/workflows/build.yaml | 4 +--- DataCollector/RedisDataCollector.php | 6 ++++++ DependencyInjection/BlablacarRedisExtension.php | 10 +++------- README.md | 2 +- composer.json | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 59f80c1..d1e0688 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,10 +19,8 @@ jobs: strategy: matrix: php: - - 5.4 - - 5.5 - - 5.6 - 7.1 + - 7.4 services: redis: diff --git a/DataCollector/RedisDataCollector.php b/DataCollector/RedisDataCollector.php index e296d9a..4697c43 100644 --- a/DataCollector/RedisDataCollector.php +++ b/DataCollector/RedisDataCollector.php @@ -66,4 +66,10 @@ public function getDuration() return $time; } + + public function reset() + { + $this->data = []; + $this->clients = []; + } } diff --git a/DependencyInjection/BlablacarRedisExtension.php b/DependencyInjection/BlablacarRedisExtension.php index 6d80fd1..7a68e92 100644 --- a/DependencyInjection/BlablacarRedisExtension.php +++ b/DependencyInjection/BlablacarRedisExtension.php @@ -2,18 +2,14 @@ namespace Blablacar\RedisBundle\DependencyInjection; +use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\DefinitionDecorator; -/** - * BlablacarRedisExtension - */ class BlablacarRedisExtension extends Extension { /** @@ -37,7 +33,7 @@ public function load(array $configs, ContainerBuilder $container) foreach ($config['clients'] as $name => $clientConfig) { $id = sprintf('blablacar_redis.client.%s', $name); - $baseClientDefinition = new DefinitionDecorator('blablacar_redis.client.base'); + $baseClientDefinition = new ChildDefinition('blablacar_redis.client.base'); $baseClientDefinition ->replaceArgument(0, $clientConfig['host']) ->replaceArgument(1, $clientConfig['port']) @@ -54,7 +50,7 @@ public function load(array $configs, ContainerBuilder $container) $container->setDefinition($id.'.base', $baseClientDefinition)->setPublic(false); $container - ->setDefinition($id, new DefinitionDecorator('blablacar_redis.client.logger')) + ->setDefinition($id, new ChildDefinition('blablacar_redis.client.logger')) ->replaceArgument(0, new Reference($id.'.base')) ; $container diff --git a/README.md b/README.md index 23acd3c..a1be75e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/blablacar/BlablacarRedisBundle.png)](https://travis-ci.org/blablacar/BlablacarRedisBundle) -A bundle to use redis inside your Symfony2 application +A bundle to use redis inside your Symfony application ## Installation diff --git a/composer.json b/composer.json index 794561d..50abed2 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ } ], "require": { - "php": "^5.4 || ^7.0", - "blablacar/redis-client": "^1.0" + "php": "^7.1", + "blablacar/redis-client": "^1.0", + "symfony/dependency-injection": "^3.3 || ^4.0" }, "require-dev": { "phpspec/prophecy": "^1.1", "phpunit/phpunit": "^4.0 || ^5.0", "symfony/config": "^2.3 || ^3.0", - "symfony/dependency-injection": "^2.3 || ^3.0", "symfony/http-kernel": "^2.3 || ^3.0" }, "autoload": {