@@ -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 |
@@ -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 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (!call_user_func([$params['adapter'], 'supportCountStrategy'])) { |
| 53 | - throw new \InvalidArgumentException(get_class($params['adapter']) . " doesn't support Count Strategy."); |
|
| 53 | + throw new \InvalidArgumentException(get_class($params['adapter']) . " doesn't support Count Strategy."); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -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; |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | foreach ($result->getWriteErrors() as $writeError) { |
| 253 | 253 | $errorMessage .= 'Operation#' . $writeError->getIndex() . ': ' . $writeError->getMessage() . ' (' . $writeError->getCode() . ')' . "\n"; |
| 254 | 254 | } |
| 255 | - throw new StorageException('failed '.$command.' the value : ' . $errorMessage); |
|
| 255 | + throw new StorageException('failed ' . $command . ' the value : ' . $errorMessage); |
|
| 256 | 256 | } |
| 257 | 257 | } catch (\MongoDB\Driver\Exception\Exception $ex) { |
| 258 | 258 | throw new StorageException('adapter error : ' . $ex->getMessage()); |