@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * the status between trip and calm down. |
| 31 | 31 | * @var int |
| 32 | 32 | */ |
| 33 | - const STATUS_TRIPPED = 2; |
|
| 33 | + const STATUS_TRIPPED = 2; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @var \Ackintosh\Ganesha\StrategyInterface |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | throw new StorageException('Failed to remove expired elements. service: ' . $service); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $r = $this->redis->zCard($service); |
|
| 48 | + $r = $this->redis->zCard($service); |
|
| 49 | 49 | } catch (\RedisException $e) { |
| 50 | 50 | throw new StorageException($e->getMessage()); |
| 51 | 51 | } |
@@ -227,7 +227,7 @@ |
||
| 227 | 227 | |
| 228 | 228 | private static function serviceNameDecorator($timeWindow, $current = true) |
| 229 | 229 | { |
| 230 | - return function ($service) use ($timeWindow, $current) { |
|
| 230 | + return function($service) use ($timeWindow, $current) { |
|
| 231 | 231 | return sprintf( |
| 232 | 232 | '%s.%d', |
| 233 | 233 | $service, |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __invoke(callable $handler) |
| 36 | 36 | { |
| 37 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
| 37 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
| 38 | 38 | $serviceName = $this->serviceNameExtractor->extract($request, $options); |
| 39 | 39 | |
| 40 | 40 | if (!$this->ganesha->isAvailable($serviceName)) { |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | $promise = $handler($request, $options); |
| 49 | 49 | |
| 50 | 50 | return $promise->then( |
| 51 | - function ($value) use ($serviceName) { |
|
| 51 | + function($value) use ($serviceName) { |
|
| 52 | 52 | $this->ganesha->success($serviceName); |
| 53 | 53 | return \GuzzleHttp\Promise\promise_for($value); |
| 54 | 54 | }, |
| 55 | - function ($reason) use ($serviceName) { |
|
| 55 | + function($reason) use ($serviceName) { |
|
| 56 | 56 | $this->ganesha->failure($serviceName); |
| 57 | 57 | return \GuzzleHttp\Promise\rejection_for($reason); |
| 58 | 58 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | break; |
| 24 | 24 | case 'memcached': |
| 25 | 25 | $m = new \Memcached(); |
| 26 | - $m->addServer(getenv('GANESHA_EXAMPLE_MEMCACHED') ?: 'localhost' , 11211); |
|
| 26 | + $m->addServer(getenv('GANESHA_EXAMPLE_MEMCACHED') ?: 'localhost', 11211); |
|
| 27 | 27 | $adapter = new \Ackintosh\Ganesha\Storage\Adapter\Memcached($m); |
| 28 | 28 | break; |
| 29 | 29 | default: |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | break; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $ganesha = Builder::build([ |
|
| 34 | + $ganesha = Builder::build([ |
|
| 35 | 35 | 'adapter' => $adapter, |
| 36 | 36 | 'timeWindow' => TIME_WINDOW, |
| 37 | 37 | 'failureRateThreshold' => FAILURE_RATE, |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | __EOS__; |
| 54 | 54 | |
| 55 | - $ganesha->subscribe(function ($event, $service, $message) use ($messageOnTripped, $messageOnCalmedDown) { |
|
| 55 | + $ganesha->subscribe(function($event, $service, $message) use ($messageOnTripped, $messageOnCalmedDown) { |
|
| 56 | 56 | switch ($event) { |
| 57 | 57 | case Ganesha::EVENT_TRIPPED: |
| 58 | 58 | echo $messageOnTripped; |