Completed
Pull Request — master (#1225)
by Antoine
03:32
created
src/PathResolver/OperationPathResolverInterface.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
      * @param array       $operation          The operation metadata
28 28
      * @param string|bool $operationType      One of the constants defined in ApiPlatform\Core\Api\OperationType
29 29
      *                                        If the property is a boolean, true represents OperationType::COLLECTION, false is for OperationType::ITEM
30
-     * @param string      $operationName      The operation name
31 30
      *
32 31
      * @return string
33 32
      */
Please login to merge, or discard this patch.
src/Bridge/Symfony/Routing/RouteNameGenerator.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,16 +50,16 @@
 block discarded – undo
50 50
     {
51 51
         if (OperationType::SUBRESOURCE === $operationType = OperationTypeDeprecationHelper::getOperationType($operationType)) {
52 52
             if (!isset($subresourceContext['property'])) {
53
-              throw new InvalidArgumentException('Missing "property" to generate a route name from a subresource');
53
+                throw new InvalidArgumentException('Missing "property" to generate a route name from a subresource');
54 54
             }
55 55
 
56 56
             return sprintf(
57
-              '%s%s_%s_%s%s',
58
-              static::ROUTE_NAME_PREFIX,
59
-              self::routeNameResolver($resourceShortName),
60
-              self::routeNameResolver($subresourceContext['property'], $subresourceContext['collection'] ?? false),
61
-              $operationName,
62
-              self::SUBRESOURCE_SUFFIX
57
+                '%s%s_%s_%s%s',
58
+                static::ROUTE_NAME_PREFIX,
59
+                self::routeNameResolver($resourceShortName),
60
+                self::routeNameResolver($subresourceContext['property'], $subresourceContext['collection'] ?? false),
61
+                $operationName,
62
+                self::SUBRESOURCE_SUFFIX
63 63
             );
64 64
         }
65 65
 
Please login to merge, or discard this patch.
src/Bridge/Symfony/Routing/RouterOperationPathResolver.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 
14 14
 namespace ApiPlatform\Core\Bridge\Symfony\Routing;
15 15
 
16
-use ApiPlatform\Core\Api\OperationType;
17 16
 use ApiPlatform\Core\Api\OperationTypeDeprecationHelper;
18 17
 use ApiPlatform\Core\Exception\InvalidArgumentException;
19 18
 use ApiPlatform\Core\PathResolver\OperationPathResolverInterface;
Please login to merge, or discard this patch.
src/Hydra/Serializer/DocumentationNormalizer.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
      * @param string           $prefixedShortName
202 202
      * @param bool             $collection
203 203
      *
204
-     * @return array
204
+     * @return string
205 205
      */
206 206
     private function getHydraOperations(string $resourceClass, ResourceMetadata $resourceMetadata, string $prefixedShortName, bool $collection): array
207 207
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * file that was distributed with this source code.
10 10
  */
11 11
 
12
-declare(strict_types=1);
12
+declare(strict_types = 1);
13 13
 
14 14
 namespace ApiPlatform\Core\Hydra\Serializer;
15 15
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     {
245 245
         if (OperationType::COLLECTION === $operationType) {
246 246
             $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
247
-        } else if(OperationType::ITEM === $operationType) {
247
+        } else if (OperationType::ITEM === $operationType) {
248 248
             $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
249 249
         } else {
250 250
             $method = 'GET';
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
             $propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName);
220 220
 
221 221
             if (!$propertyMetadata->hasSubresource()) {
222
-               continue;
222
+                continue;
223 223
             }
224 224
 
225 225
             $subresourceMetadata = $this->resourceMetadataFactory->create($propertyMetadata->getSubresource()->getResourceClass());
Please login to merge, or discard this patch.