@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ->scalarNode('base_url') |
| 102 | 102 | ->defaultValue(null) |
| 103 | 103 | ->validate() |
| 104 | - ->ifTrue(function ($v) { |
|
| 104 | + ->ifTrue(function($v) { |
|
| 105 | 105 | return !is_string($v); |
| 106 | 106 | }) |
| 107 | 107 | ->thenInvalid('base_url can be: string') |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ->scalarNode('handler') |
| 118 | 118 | ->defaultValue(null) |
| 119 | 119 | ->validate() |
| 120 | - ->ifTrue(function ($v) { |
|
| 120 | + ->ifTrue(function($v) { |
|
| 121 | 121 | return $v !== null && (!is_string($v) || !class_exists($v)); |
| 122 | 122 | }) |
| 123 | 123 | ->thenInvalid('handler must be a valid FQCN for a loaded class') |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ->end() |
| 126 | 126 | ->arrayNode('options') |
| 127 | 127 | ->validate() |
| 128 | - ->ifTrue(function ($options) { |
|
| 128 | + ->ifTrue(function($options) { |
|
| 129 | 129 | return count($options['form_params']) && count($options['multipart']); |
| 130 | 130 | }) |
| 131 | 131 | ->thenInvalid('You cannot use form_params and multipart at the same time.') |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ->end() |
| 139 | 139 | ->variableNode('allow_redirects') |
| 140 | 140 | ->validate() |
| 141 | - ->ifTrue(function ($v) { |
|
| 141 | + ->ifTrue(function($v) { |
|
| 142 | 142 | return !is_array($v) && !is_bool($v); |
| 143 | 143 | }) |
| 144 | 144 | ->thenInvalid('allow_redirects can be: bool or array') |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | ->end() |
| 147 | 147 | ->variableNode('auth') |
| 148 | 148 | ->validate() |
| 149 | - ->ifTrue(function ($v) { |
|
| 149 | + ->ifTrue(function($v) { |
|
| 150 | 150 | return !is_array($v) && !is_string($v); |
| 151 | 151 | }) |
| 152 | 152 | ->thenInvalid('auth can be: string or array') |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ->end() |
| 155 | 155 | ->variableNode('query') |
| 156 | 156 | ->validate() |
| 157 | - ->ifTrue(function ($v) { |
|
| 157 | + ->ifTrue(function($v) { |
|
| 158 | 158 | return !is_string($v) && !is_array($v); |
| 159 | 159 | }) |
| 160 | 160 | ->thenInvalid('query can be: string or array') |
@@ -163,16 +163,16 @@ discard block |
||
| 163 | 163 | ->arrayNode('curl') |
| 164 | 164 | ->beforeNormalization() |
| 165 | 165 | ->ifArray() |
| 166 | - ->then(function (array $curlOptions) { |
|
| 166 | + ->then(function(array $curlOptions) { |
|
| 167 | 167 | $result = []; |
| 168 | 168 | |
| 169 | 169 | foreach ($curlOptions as $key => $value) { |
| 170 | - $optionName = 'CURLOPT_' . strtoupper($key); |
|
| 170 | + $optionName = 'CURLOPT_'.strtoupper($key); |
|
| 171 | 171 | |
| 172 | 172 | if (!defined($optionName)) { |
| 173 | 173 | throw new InvalidConfigurationException(sprintf( |
| 174 | - 'Invalid curl option in eight_points_guzzle: %s. ' . |
|
| 175 | - 'Ex: use sslversion for CURLOPT_SSLVERSION option. ' . PHP_EOL . |
|
| 174 | + 'Invalid curl option in eight_points_guzzle: %s. '. |
|
| 175 | + 'Ex: use sslversion for CURLOPT_SSLVERSION option. '.PHP_EOL. |
|
| 176 | 176 | 'See all available options: http://php.net/manual/en/function.curl-setopt.php', |
| 177 | 177 | $key |
| 178 | 178 | )); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | ->end() |
| 190 | 190 | ->variableNode('cert') |
| 191 | 191 | ->validate() |
| 192 | - ->ifTrue(function ($v) { |
|
| 192 | + ->ifTrue(function($v) { |
|
| 193 | 193 | return !is_string($v) && (!is_array($v) || count($v) !== 2); |
| 194 | 194 | }) |
| 195 | 195 | ->thenInvalid('cert can be: string or array with two entries (path and password)') |
@@ -197,12 +197,12 @@ discard block |
||
| 197 | 197 | ->end() |
| 198 | 198 | ->scalarNode('connect_timeout') |
| 199 | 199 | ->beforeNormalization() |
| 200 | - ->always(function ($v) { |
|
| 200 | + ->always(function($v) { |
|
| 201 | 201 | return is_numeric($v) ? (float) $v : $v; |
| 202 | 202 | }) |
| 203 | 203 | ->end() |
| 204 | 204 | ->validate() |
| 205 | - ->ifTrue(function ($v) { |
|
| 205 | + ->ifTrue(function($v) { |
|
| 206 | 206 | return !is_float($v) && !(is_string($v) && strpos($v, 'env_') === 0); |
| 207 | 207 | }) |
| 208 | 208 | ->thenInvalid('connect_timeout can be: float') |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | ->booleanNode('debug')->end() |
| 212 | 212 | ->variableNode('decode_content') |
| 213 | 213 | ->validate() |
| 214 | - ->ifTrue(function ($v) { |
|
| 214 | + ->ifTrue(function($v) { |
|
| 215 | 215 | return !is_string($v) && !is_bool($v); |
| 216 | 216 | }) |
| 217 | 217 | ->thenInvalid('decode_content can be: bool or string (gzip, compress, deflate, etc...)') |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ->end() |
| 228 | 228 | ->scalarNode('sink') |
| 229 | 229 | ->validate() |
| 230 | - ->ifTrue(function ($v) { |
|
| 230 | + ->ifTrue(function($v) { |
|
| 231 | 231 | return !is_string($v); |
| 232 | 232 | }) |
| 233 | 233 | ->thenInvalid('sink can be: string') |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | ->booleanNode('http_errors')->end() |
| 237 | 237 | ->variableNode('expect') |
| 238 | 238 | ->validate() |
| 239 | - ->ifTrue(function ($v) { |
|
| 239 | + ->ifTrue(function($v) { |
|
| 240 | 240 | return !is_bool($v) && !is_int($v); |
| 241 | 241 | }) |
| 242 | 242 | ->thenInvalid('expect can be: bool or int') |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | ->end() |
| 245 | 245 | ->variableNode('ssl_key') |
| 246 | 246 | ->validate() |
| 247 | - ->ifTrue(function ($v) { |
|
| 247 | + ->ifTrue(function($v) { |
|
| 248 | 248 | return !is_string($v) && (!is_array($v) || count($v) !== 2); |
| 249 | 249 | }) |
| 250 | 250 | ->thenInvalid('ssl_key can be: string or array with two entries (path and password)') |
@@ -254,12 +254,12 @@ discard block |
||
| 254 | 254 | ->booleanNode('synchronous')->end() |
| 255 | 255 | ->scalarNode('read_timeout') |
| 256 | 256 | ->beforeNormalization() |
| 257 | - ->always(function ($v) { |
|
| 257 | + ->always(function($v) { |
|
| 258 | 258 | return is_numeric($v) ? (float) $v : $v; |
| 259 | 259 | }) |
| 260 | 260 | ->end() |
| 261 | 261 | ->validate() |
| 262 | - ->ifTrue(function ($v) { |
|
| 262 | + ->ifTrue(function($v) { |
|
| 263 | 263 | return !is_float($v) && !(is_string($v) && strpos($v, 'env_') === 0); |
| 264 | 264 | }) |
| 265 | 265 | ->thenInvalid('read_timeout can be: float') |
@@ -267,12 +267,12 @@ discard block |
||
| 267 | 267 | ->end() |
| 268 | 268 | ->scalarNode('timeout') |
| 269 | 269 | ->beforeNormalization() |
| 270 | - ->always(function ($v) { |
|
| 270 | + ->always(function($v) { |
|
| 271 | 271 | return is_numeric($v) ? (float) $v : $v; |
| 272 | 272 | }) |
| 273 | 273 | ->end() |
| 274 | 274 | ->validate() |
| 275 | - ->ifTrue(function ($v) { |
|
| 275 | + ->ifTrue(function($v) { |
|
| 276 | 276 | return !is_float($v) && !(is_string($v) && strpos($v, 'env_') === 0); |
| 277 | 277 | }) |
| 278 | 278 | ->thenInvalid('timeout can be: float') |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | ->end() |
| 281 | 281 | ->variableNode('verify') |
| 282 | 282 | ->validate() |
| 283 | - ->ifTrue(function ($v) { |
|
| 283 | + ->ifTrue(function($v) { |
|
| 284 | 284 | return !is_bool($v) && !is_string($v); |
| 285 | 285 | }) |
| 286 | 286 | ->thenInvalid('verify can be: bool or string') |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | ->end() |
| 311 | 311 | ->scalarNode('version') |
| 312 | 312 | ->validate() |
| 313 | - ->ifTrue(function ($v) { |
|
| 313 | + ->ifTrue(function($v) { |
|
| 314 | 314 | return !is_string($v) && !is_float($v); |
| 315 | 315 | }) |
| 316 | 316 | ->thenInvalid('version can be: string or float') |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | } elseif ($v === 0 || $v === false) { |
| 340 | 340 | return Logger::LOG_MODE_NONE; |
| 341 | 341 | } else { |
| 342 | - return constant(Logger::class .'::LOG_MODE_' . strtoupper($v)); |
|
| 342 | + return constant(Logger::class.'::LOG_MODE_'.strtoupper($v)); |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | } |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | $container->setDefinition($serviceName, $client); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - $clientsWithLogging = array_filter($config['clients'], function ($options) use ($logging) { |
|
| 97 | + $clientsWithLogging = array_filter($config['clients'], function($options) use ($logging) { |
|
| 98 | 98 | return $options['logging'] !== false && $logging !== false; |
| 99 | 99 | }); |
| 100 | 100 | |
| 101 | - if (count($clientsWithLogging)>0) { |
|
| 101 | + if (count($clientsWithLogging) > 0) { |
|
| 102 | 102 | $this->defineTwigDebugExtension($container); |
| 103 | 103 | $this->defineDataCollector($container, $config['slow_response_time'] / 1000); |
| 104 | 104 | $this->defineFormatter($container); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $container->setDefinition($eventServiceName, $eventService); |
| 127 | 127 | |
| 128 | 128 | // Create the event Dispatch Middleware |
| 129 | - $eventExpression = new Expression(sprintf("service('%s').dispatchEvent()", $eventServiceName)); |
|
| 129 | + $eventExpression = new Expression(sprintf("service('%s').dispatchEvent()", $eventServiceName)); |
|
| 130 | 130 | |
| 131 | 131 | $handler = new Definition(HandlerStack::class); |
| 132 | 132 | $handler->setFactory([HandlerStack::class, 'create']); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | $dataCollectorDefinition = new Definition('%eight_points_guzzle.data_collector.class%'); |
| 218 | 218 | |
| 219 | - $dataCollectorDefinition->addArgument(array_map(function ($loggerId) : Reference { |
|
| 219 | + $dataCollectorDefinition->addArgument(array_map(function($loggerId) : Reference { |
|
| 220 | 220 | return new Reference($loggerId); |
| 221 | 221 | }, array_keys($container->findTaggedServiceIds('eight_points_guzzle.logger')))); |
| 222 | 222 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $response->getBody()->rewind(); |
| 60 | 60 | } |
| 61 | 61 | } else { |
| 62 | - $this->setBody(EightPointsGuzzleBundle::class . ': [response body log disabled]'); |
|
| 62 | + $this->setBody(EightPointsGuzzleBundle::class.': [response body log disabled]'); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |