From ce57aad9e32606e020a064bb4dc63c2104b1bf20 Mon Sep 17 00:00:00 2001 From: Romain Pierre Date: Thu, 30 Nov 2017 22:25:22 +0100 Subject: [PATCH] Provides compatibility with Symfony 4 --- .travis.yml | 11 +++++++---- DependencyInjection/SncRedisExtension.php | 1 + Resources/config/redis.xml | 6 ++++++ Tests/CommandTestCase.php | 2 +- composer.json | 10 +++++----- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3c9b82f..06279545 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,19 @@ php: - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm matrix: include: - php: 5.6 - env: SYMFONY_VERSION="2.7.*" + env: SYMFONY_VERSION="2.7.*" SYMFONY_DEPRECATIONS_HELPER="weak" - php: 5.6 - env: SYMFONY_VERSION="2.8.*" SYMFONY_DEPRECATIONS_HELPER="strict" + env: SYMFONY_VERSION="2.8.*" - php: 5.6 - env: SYMFONY_VERSION="3.0.*" SYMFONY_DEPRECATIONS_HELPER="strict" + env: SYMFONY_VERSION="3.0.*" + - php: 7.1 + env: SYMFONY_VERSION="4.0.*" allow_failures: - php: hhvm @@ -29,7 +32,7 @@ cache: env: global: - - SYMFONY_DEPRECATIONS_HELPER="weak" + - SYMFONY_DEPRECATIONS_HELPER="strict" before_install: - phpenv config-rm xdebug.ini || true diff --git a/DependencyInjection/SncRedisExtension.php b/DependencyInjection/SncRedisExtension.php index f6c704b4..c386fbef 100644 --- a/DependencyInjection/SncRedisExtension.php +++ b/DependencyInjection/SncRedisExtension.php @@ -190,6 +190,7 @@ protected function loadPredisClient(array $client, ContainerBuilder $container) $optionDef->addArgument($client['options']); $container->setDefinition($optionId, $optionDef); $clientDef = new Definition($container->getParameter('snc_redis.client.class')); + $clientDef->setPublic(true); $clientDef->addTag('snc_redis.client', array('alias' => $client['alias'])); if (1 === $connectionCount) { $clientDef->addArgument(new Reference(sprintf('snc_redis.connection.%s_parameters.%s', $connectionAliases[0], $client['alias']))); diff --git a/Resources/config/redis.xml b/Resources/config/redis.xml index c57ccbd2..59dd1329 100644 --- a/Resources/config/redis.xml +++ b/Resources/config/redis.xml @@ -16,6 +16,12 @@ + + + + + + diff --git a/Tests/CommandTestCase.php b/Tests/CommandTestCase.php index b73c3cfc..ba253a21 100644 --- a/Tests/CommandTestCase.php +++ b/Tests/CommandTestCase.php @@ -55,7 +55,7 @@ public function setUp() $kernel->expects($this->once()) ->method('getBundles') ->will($this->returnValue(array())); - $kernel->expects($this->once()) + $kernel->expects($this->any()) ->method('getContainer') ->will($this->returnValue($this->container)); $this->application = new Application($kernel); diff --git a/composer.json b/composer.json index 08048a2b..5459fb99 100644 --- a/composer.json +++ b/composer.json @@ -14,15 +14,15 @@ }], "require": { "php": ">=5.3.3", - "symfony/framework-bundle": "^2.7 || ^3.0", - "symfony/yaml": "^2.7 || ^3.0" + "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0", + "symfony/yaml": "^2.7 || ^3.0 || ^4.0" }, "require-dev": { "doctrine/cache": "1.*", "predis/predis": "^1.0", - "symfony/console": "^2.7 || ^3.0", - "symfony/phpunit-bridge": "^2.7 || ^3.0", - "phpunit/phpunit": "4.8.*" + "symfony/console": "^2.7 || ^3.0 || ^4.0", + "symfony/phpunit-bridge": "^2.7 || ^3.0 || ^4.0", + "phpunit/phpunit": "^4.8 || ^5.4" }, "suggest": { "monolog/monolog": "If you want to use the monolog redis handler.",