@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function commandToRequestTransformer() |
| 53 | 53 | { |
| 54 | - return function (CommandInterface $command) { |
|
| 54 | + return function(CommandInterface $command) { |
|
| 55 | 55 | if (!$this->service->hasOperation($command->getName())) { |
| 56 | 56 | throw new CommandException( |
| 57 | 57 | sprintf( |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function responseToResultTransformer() |
| 119 | 119 | { |
| 120 | - return function ( |
|
| 120 | + return function( |
|
| 121 | 121 | ResponseInterface $response, |
| 122 | 122 | RequestInterface $request, |
| 123 | 123 | CommandInterface $command |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | public function badResponseExceptionParser() |
| 152 | 152 | { |
| 153 | - return function (CommandInterface $command, GuzzleBadResponseException $e) { |
|
| 153 | + return function(CommandInterface $command, GuzzleBadResponseException $e) { |
|
| 154 | 154 | $operation = $this->service->getOperation($command->getName()); |
| 155 | 155 | |
| 156 | 156 | $this->processResponseError( |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $rootNode |
| 33 | 33 | ->validate() |
| 34 | - ->always(function ($v) { |
|
| 34 | + ->always(function($v) { |
|
| 35 | 35 | foreach ($v['operations'] as $name => $operation) { |
| 36 | 36 | if (!$operation['requestProtocol']) { |
| 37 | 37 | $v['operations'][$name]['requestProtocol'] = $v['protocol']; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ->isRequired() |
| 132 | 132 | ->beforeNormalization() |
| 133 | 133 | ->ifString() |
| 134 | - ->then(function ($v) { |
|
| 134 | + ->then(function($v) { |
|
| 135 | 135 | return strtoupper($v); |
| 136 | 136 | }) |
| 137 | 137 | ->end() |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | ->cannotBeEmpty() |
| 146 | 146 | ->validate() |
| 147 | 147 | ->ifString() |
| 148 | - ->then(function ($v) { |
|
| 148 | + ->then(function($v) { |
|
| 149 | 149 | return '/'.ltrim($v, '/'); |
| 150 | 150 | }) |
| 151 | 151 | ->end() |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | $rootNode |
| 245 | 245 | ->beforeNormalization() |
| 246 | - ->always(function ($v) use ($fromOperation) { |
|
| 246 | + ->always(function($v) use ($fromOperation) { |
|
| 247 | 247 | if (!$fromOperation) { |
| 248 | 248 | if (isset($v['shape'])) { |
| 249 | 249 | throw new InvalidConfigurationException('Unrecognized option "shape"'); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | ->arrayNode('members') |
| 278 | 278 | ->beforeNormalization() |
| 279 | 279 | ->ifArray() |
| 280 | - ->then(function ($v) { |
|
| 280 | + ->then(function($v) { |
|
| 281 | 281 | foreach ($v as $name => $member) { |
| 282 | 282 | if (!isset($member['locationName'])) { |
| 283 | 283 | $v[$name]['locationName'] = $name; |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $availableOperators = ['===', '!==', '==', '!=', '<', '<=', '>=', '>']; |
| 363 | 363 | $rootNode |
| 364 | 364 | ->beforeNormalization() |
| 365 | - ->always(function ($v) use ($fromOperation) { |
|
| 365 | + ->always(function($v) use ($fromOperation) { |
|
| 366 | 366 | if (!$fromOperation) { |
| 367 | 367 | if (isset($v['errorShape'])) { |
| 368 | 368 | throw new InvalidConfigurationException('Unrecognized option "errorShape"'); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | // Modify provided callbacks to track results. |
| 130 | 130 | $results = []; |
| 131 | - $options['fulfilled'] = function ($v, $k) use (&$results, $options) { |
|
| 131 | + $options['fulfilled'] = function($v, $k) use (&$results, $options) { |
|
| 132 | 132 | if (isset($options['fulfilled'])) { |
| 133 | 133 | $options['fulfilled']($v, $k); |
| 134 | 134 | } |
| 135 | 135 | $results[$k] = $v; |
| 136 | 136 | }; |
| 137 | - $options['rejected'] = function ($v, $k) use (&$results, $options) { |
|
| 137 | + $options['rejected'] = function($v, $k) use (&$results, $options) { |
|
| 138 | 138 | if (isset($options['rejected'])) { |
| 139 | 139 | $options['rejected']($v, $k); |
| 140 | 140 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | // Execute multiple commands synchronously, then sort and return the results. |
| 145 | 145 | return $this->executeAllAsync($commands, $options) |
| 146 | - ->then(function () use (&$results) { |
|
| 146 | + ->then(function() use (&$results) { |
|
| 147 | 147 | ksort($results); |
| 148 | 148 | |
| 149 | 149 | return $results; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | // Convert the iterator of commands to a generator of promises. |
| 165 | 165 | $commands = Promise\iter_for($commands); |
| 166 | - $promises = function () use ($commands) { |
|
| 166 | + $promises = function() use ($commands) { |
|
| 167 | 167 | foreach ($commands as $key => $command) { |
| 168 | 168 | if (!$command instanceof CommandInterface) { |
| 169 | 169 | throw new \InvalidArgumentException('The iterator must ' |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | private function createCommandHandler() |
| 216 | 216 | { |
| 217 | - return function (CommandInterface $command) { |
|
| 218 | - return Promise\coroutine(function () use ($command) { |
|
| 217 | + return function(CommandInterface $command) { |
|
| 218 | + return Promise\coroutine(function() use ($command) { |
|
| 219 | 219 | // Prepare the HTTP options. |
| 220 | 220 | $opts = $command['@http'] ?: []; |
| 221 | 221 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * This file is part of indragunawan/rest-service package. |