Skip to content

Commit

Permalink
Ignore psalm returning generic type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jul 6, 2021
1 parent 17b4d76 commit 13f84a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/Doctrine/ODM/MongoDB/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,12 @@ public function getClassNameResolver(): ClassNameResolver
* @psalm-return ClassMetadata<T>
*
* @template T of object
*
* @psalm-suppress InvalidReturnType, InvalidReturnStatement
*/
public function getClassMetadata($className): ClassMetadata
{
/** @psalm-var ClassMetadata<T> $metadata */
$metadata = $this->metadataFactory->getMetadataFor($className);
assert($metadata instanceof ClassMetadata);

return $metadata;
return $this->metadataFactory->getMetadataFor($className);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,8 @@ public function removeFromIdentityMap(object $document): bool
* @throws InvalidArgumentException If the class does not have an identifier.
*
* @template T of object
*
* @psalm-suppress InvalidReturnStatement, InvalidReturnType
*/
public function getById($id, ClassMetadata $class): object
{
Expand Down Expand Up @@ -1653,6 +1655,8 @@ public function getById($id, ClassMetadata $class): object
* @throws InvalidArgumentException If the class does not have an identifier.
*
* @template T of object
*
* @psalm-suppress InvalidReturnStatement, InvalidReturnType
*/
public function tryGetById($id, ClassMetadata $class)
{
Expand Down

0 comments on commit 13f84a8

Please sign in to comment.