Skip to content

Commit

Permalink
Drop support for SF <3.3 and PHP < 7.1, add support for SF4 (#7)
Browse files Browse the repository at this point in the history
* Drop support for SF <3.3 and PHP < 7.1
  • Loading branch information
edouarddurieux authored Feb 14, 2022
1 parent 6ae849e commit e735692
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ jobs:
strategy:
matrix:
php:
- 5.4
- 5.5
- 5.6
- 7.1
- 7.4

services:
redis:
Expand Down
6 changes: 6 additions & 0 deletions DataCollector/RedisDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@ public function getDuration()

return $time;
}

public function reset()
{
$this->data = [];
$this->clients = [];
}
}
10 changes: 3 additions & 7 deletions DependencyInjection/BlablacarRedisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand All @@ -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'])
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit e735692

Please sign in to comment.