@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | public function __invoke(string $resourceClass = null, string $rootClass = null, string $operationName = null): callable |
| 65 | 65 | { |
| 66 | - return function ($root, $args, $context, ResolveInfo $info) use ($resourceClass, $operationName) { |
|
| 66 | + return function($root, $args, $context, ResolveInfo $info) use ($resourceClass, $operationName) { |
|
| 67 | 67 | if (null === $resourceClass) { |
| 68 | 68 | return null; |
| 69 | 69 | } |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | { |
| 30 | 30 | parent::registerFunctions(); |
| 31 | 31 | |
| 32 | - $this->register('is_granted', function ($attributes, $object = 'null') { |
|
| 32 | + $this->register('is_granted', function($attributes, $object = 'null') { |
|
| 33 | 33 | return sprintf('$auth_checker->isGranted(%s, %s)', $attributes, $object); |
| 34 | - }, function (array $variables, $attributes, $object = null) { |
|
| 34 | + }, function(array $variables, $attributes, $object = null) { |
|
| 35 | 35 | return $variables['auth_checker']->isGranted($attributes, $object); |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | return [ |
| 82 | 82 | 'token' => $token, |
| 83 | 83 | 'user' => $token->getUser(), |
| 84 | - 'roles' => array_map(function (Role $role) { |
|
| 84 | + 'roles' => array_map(function(Role $role) { |
|
| 85 | 85 | return $role->getRole(); |
| 86 | 86 | }, $roles), |
| 87 | 87 | 'trust_resolver' => $this->authenticationTrustResolver, |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Create the regex to purge all tags in just one request |
| 47 | - $parts = array_map(function ($iri) { |
|
| 47 | + $parts = array_map(function($iri) { |
|
| 48 | 48 | return sprintf('(^|\,)%s($|\,)', preg_quote($iri)); |
| 49 | 49 | }, $iris); |
| 50 | 50 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | || ( |
| 57 | 57 | '' === ($requestContent = $request->getContent()) |
| 58 | 58 | && ('POST' === $method || 'PUT' === $method) |
| 59 | - ) |
|
| 59 | + ) |
|
| 60 | 60 | ) { |
| 61 | 61 | return; |
| 62 | 62 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $source = preg_replace_callback( |
| 65 | 65 | '/(^|(?<=&))[^=[&]+/', |
| 66 | - function ($key) { |
|
| 66 | + function($key) { |
|
| 67 | 67 | return bin2hex(urldecode($key[0])); |
| 68 | 68 | }, |
| 69 | 69 | $source |
@@ -106,8 +106,7 @@ discard block |
||
| 106 | 106 | // PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str. This is why we use urldecode and then normalize to |
| 107 | 107 | // RFC 3986 with rawurlencode. |
| 108 | 108 | $parts[] = isset($keyValuePair[1]) ? |
| 109 | - rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : |
|
| 110 | - rawurlencode(urldecode($keyValuePair[0])); |
|
| 109 | + rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : rawurlencode(urldecode($keyValuePair[0])); |
|
| 111 | 110 | } |
| 112 | 111 | |
| 113 | 112 | return implode('&', $parts); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $parametersMemory = []; |
| 148 | 148 | $pathOperation['parameters'] = []; |
| 149 | 149 | |
| 150 | - foreach ($subresourceOperation['identifiers'] as list($identifier, , $hasIdentifier)) { |
|
| 150 | + foreach ($subresourceOperation['identifiers'] as list($identifier,, $hasIdentifier)) { |
|
| 151 | 151 | if (true === $hasIdentifier) { |
| 152 | 152 | $pathOperation['parameters'][] = ['name' => $identifier, 'in' => 'path', 'required' => true, 'type' => 'string']; |
| 153 | 153 | $parametersMemory[] = $identifier; |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | if (!isset($definitions[$definitionKey])) { |
| 456 | - $definitions[$definitionKey] = []; // Initialize first to prevent infinite loop |
|
| 456 | + $definitions[$definitionKey] = []; // Initialize first to prevent infinite loop |
|
| 457 | 457 | $definitions[$definitionKey] = $this->getDefinitionSchema($resourceClass, $resourceMetadata, $definitions, $serializerContext); |
| 458 | 458 | } |
| 459 | 459 | |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | ->arrayNode('swagger') |
| 129 | 129 | ->addDefaultsIfNotSet() |
| 130 | 130 | ->children() |
| 131 | - ->arrayNode('api_keys') |
|
| 132 | - ->prototype('array') |
|
| 131 | + ->arrayNode('api_keys') |
|
| 132 | + ->prototype('array') |
|
| 133 | 133 | ->children() |
| 134 | 134 | ->scalarNode('name') |
| 135 | 135 | ->info('The name of the header or query parameter containing the api key.') |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | ->values(['query', 'header']) |
| 140 | 140 | ->end() |
| 141 | 141 | ->end() |
| 142 | - ->end() |
|
| 142 | + ->end() |
|
| 143 | 143 | ->end() |
| 144 | 144 | ->end() |
| 145 | 145 | ->end() |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | ->variableNode('request_options') |
| 207 | 207 | ->defaultValue([]) |
| 208 | 208 | ->validate() |
| 209 | - ->ifTrue(function ($v) { return false === \is_array($v); }) |
|
| 209 | + ->ifTrue(function($v) { return false === \is_array($v); }) |
|
| 210 | 210 | ->thenInvalid('The request_options parameter must be an array.') |
| 211 | 211 | ->end() |
| 212 | 212 | ->info('To pass options to the client charged with the request.') |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | ->useAttributeAsKey('exception_class') |
| 255 | 255 | ->beforeNormalization() |
| 256 | 256 | ->ifArray() |
| 257 | - ->then(function (array $exceptionToStatus) { |
|
| 257 | + ->then(function(array $exceptionToStatus) { |
|
| 258 | 258 | foreach ($exceptionToStatus as &$httpStatusCode) { |
| 259 | 259 | if (\is_int($httpStatusCode)) { |
| 260 | 260 | continue; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | ->prototype('integer')->end() |
| 274 | 274 | ->validate() |
| 275 | 275 | ->ifArray() |
| 276 | - ->then(function (array $exceptionToStatus) { |
|
| 276 | + ->then(function(array $exceptionToStatus) { |
|
| 277 | 277 | foreach ($exceptionToStatus as $httpStatusCode) { |
| 278 | 278 | if ($httpStatusCode < 100 || $httpStatusCode >= 600) { |
| 279 | 279 | throw new InvalidConfigurationException(sprintf('The HTTP status code "%s" is not valid.', $httpStatusCode)); |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | ->useAttributeAsKey('format') |
| 306 | 306 | ->beforeNormalization() |
| 307 | 307 | ->ifArray() |
| 308 | - ->then(function ($v) { |
|
| 308 | + ->then(function($v) { |
|
| 309 | 309 | foreach ($v as $format => $value) { |
| 310 | 310 | if (isset($value['mime_types'])) { |
| 311 | 311 | continue; |
@@ -352,7 +352,7 @@ |
||
| 352 | 352 | */ |
| 353 | 353 | protected function createWrapCase(bool $caseSensitive): \Closure |
| 354 | 354 | { |
| 355 | - return function (string $expr) use ($caseSensitive): string { |
|
| 355 | + return function(string $expr) use ($caseSensitive): string { |
|
| 356 | 356 | if ($caseSensitive) { |
| 357 | 357 | return $expr; |
| 358 | 358 | } |