Skip to content

Commit

Permalink
Merge pull request #370 from romain-pierre/symfony4
Browse files Browse the repository at this point in the history
Provides Symfony 4 compatibility
  • Loading branch information
snc authored Dec 1, 2017
2 parents 45425d9 + ce57aad commit 58f8f3c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -29,7 +32,7 @@ cache:

env:
global:
- SYMFONY_DEPRECATIONS_HELPER="weak"
- SYMFONY_DEPRECATIONS_HELPER="strict"

before_install:
- phpenv config-rm xdebug.ini || true
Expand Down
1 change: 1 addition & 0 deletions DependencyInjection/SncRedisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])));
Expand Down
6 changes: 6 additions & 0 deletions Resources/config/redis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<tag name="data_collector" template="@SncRedis/Collector/redis.html.twig" id="redis" />
<argument type="service" id="snc_redis.logger" />
</service>
<service id="snc_redis.command.flush_all" class="Snc\RedisBundle\Command\RedisFlushallCommand" public="false">
<tag name="console.command" command="redis:flushall" />
</service>
<service id="snc_redis.command.flush_db" class="Snc\RedisBundle\Command\RedisFlushdbCommand" public="false">
<tag name="console.command" command="redis:flushdb" />
</service>
</services>

</container>
2 changes: 1 addition & 1 deletion Tests/CommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 58f8f3c

Please sign in to comment.