Skip to content
Permalink
Browse files

refactor: Fix nullable types.

  • Loading branch information
tarlepp committed Nov 16, 2019
1 parent b97eb8f commit b29d0ad426a15cc84a595adf9de0e929a11a8de0
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ArgumentResolver/EntityValueResolver.php
@@ -68,7 +68,7 @@ public function __construct(ResourceCollection $resourceCollection)
public function supports(Request $request, ArgumentMetadata $argument): bool
{
return is_string($request->get($argument->getName()))
&& is_subclass_of($argument->getType(), EntityInterface::class)
&& is_subclass_of((string)$argument->getType(), EntityInterface::class, true)
&& $this->resourceCollection->hasEntityResource($argument->getType());
}
@@ -84,7 +84,7 @@ public function supports(Request $request, ArgumentMetadata $argument): bool
*/
public function resolve(Request $request, ArgumentMetadata $argument): Generator
{
yield $this->resourceCollection->getEntityResource($argument->getType())
yield $this->resourceCollection->getEntityResource((string)$argument->getType())
->findOne($request->get($argument->getName()), !$argument->isNullable());
}
}

0 comments on commit b29d0ad

Please sign in to comment.
You can’t perform that action at this time.