Skip to content

Commit 3d37a8b

Browse files
authored
fix(metadata): ApiResource: add some return types and fix PHPdoc (api-platform#4425)
1 parent 11fa1e7 commit 3d37a8b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Metadata/Resource/Factory/AttributesResourceMetadataCollectionFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@
3535
use Psr\Log\NullLogger;
3636

3737
/**
38-
* Creates a resource metadata from {@see Resource} annotations.
38+
* Creates a resource metadata from {@see ApiResource} annotations.
3939
*
4040
* @author Antoine Bluchet <[email protected]>
4141
* @experimental
4242
*/
4343
final class AttributesResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
4444
{
4545
use DeprecationMetadataTrait;
46+
4647
private $defaults;
4748
private $decorated;
4849
private $logger;
@@ -216,7 +217,7 @@ private function getOperationWithDefaults(ApiResource $resource, $operation): ar
216217
];
217218
}
218219

219-
private function getResourceWithDefaults(string $resourceClass, string $shortName, ApiResource $resource)
220+
private function getResourceWithDefaults(string $resourceClass, string $shortName, ApiResource $resource): ApiResource
220221
{
221222
$resource = $resource
222223
->withShortName($shortName)
@@ -262,7 +263,7 @@ private function hasSameOperation(ApiResource $resource, string $operationClass,
262263
return false;
263264
}
264265

265-
private function addDefaultGraphQlOperations(ApiResource $resource)
266+
private function addDefaultGraphQlOperations(ApiResource $resource): ApiResource
266267
{
267268
$graphQlOperations = [];
268269
foreach ([new QueryCollection(), new Query(), (new Mutation())->withName('update'), (new Mutation())->withName('delete'), (new Mutation())->withName('create')] as $i => $operation) {

0 commit comments

Comments
 (0)