Skip to content

Commit

Permalink
Merge 0e5a30c into 11fa1e7
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Sep 6, 2021
2 parents 11fa1e7 + 0e5a30c commit f651b81
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -35,14 +35,15 @@
use Psr\Log\NullLogger;

/**
* Creates a resource metadata from {@see Resource} annotations.
* Creates a resource metadata from {@see ApiResource} annotations.
*
* @author Antoine Bluchet <soyuka@gmail.com>
* @experimental
*/
final class AttributesResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
{
use DeprecationMetadataTrait;

private $defaults;
private $decorated;
private $logger;
Expand Down Expand Up @@ -216,7 +217,7 @@ private function getOperationWithDefaults(ApiResource $resource, $operation): ar
];
}

private function getResourceWithDefaults(string $resourceClass, string $shortName, ApiResource $resource)
private function getResourceWithDefaults(string $resourceClass, string $shortName, ApiResource $resource): ApiResource
{
$resource = $resource
->withShortName($shortName)
Expand Down Expand Up @@ -245,7 +246,7 @@ private function hasResourceAttributes(\ReflectionClass $reflectionClass): bool

/**
* Does the resource already have an operation of the $operationClass type?
* Useful to determine if we need to create a new ApiResource when the class has only operation attributes, for example:.
* Useful to determine if we need to create a new ApiResource when the class has only operation attributes, for example:
*
* #[Get]
* #[Get(uriTemplate: '/alternate')]
Expand All @@ -262,7 +263,7 @@ private function hasSameOperation(ApiResource $resource, string $operationClass,
return false;
}

private function addDefaultGraphQlOperations(ApiResource $resource)
private function addDefaultGraphQlOperations(ApiResource $resource): ApiResource
{
$graphQlOperations = [];
foreach ([new QueryCollection(), new Query(), (new Mutation())->withName('update'), (new Mutation())->withName('delete'), (new Mutation())->withName('create')] as $i => $operation) {
Expand Down

0 comments on commit f651b81

Please sign in to comment.