diff --git a/stubs/EntityManagerInterface.phpstub b/stubs/EntityManagerInterface.phpstub index acdf44f..0d7b95b 100644 --- a/stubs/EntityManagerInterface.phpstub +++ b/stubs/EntityManagerInterface.phpstub @@ -21,7 +21,7 @@ interface EntityManagerInterface extends ObjectManager * * @return ?T * - * @template T + * @template T of object */ public function find(string $entityName, $id, ?int $lockMode = null, ?int $lockVersion = null); diff --git a/stubs/EntityRepository.phpstub b/stubs/EntityRepository.phpstub index 0e2c4ba..c413abe 100644 --- a/stubs/EntityRepository.phpstub +++ b/stubs/EntityRepository.phpstub @@ -14,13 +14,22 @@ use Doctrine\Persistence\ObjectRepository; */ class EntityRepository implements ObjectRepository, Selectable { - /** @var string */ + /** + * @var class-string + * @psalm-suppress PropertyNotSetInConstructor + */ protected $_entityName; - /** @var EntityManagerInterface */ + /** + * @var EntityManagerInterface + * @psalm-suppress PropertyNotSetInConstructor + */ protected $_em; - /** @var Mapping\ClassMetadata */ + /** + * @var Mapping\ClassMetadata + * @psalm-suppress PropertyNotSetInConstructor + */ protected $_class; /** @param Mapping\ClassMetadata $class */ @@ -44,8 +53,10 @@ class EntityRepository implements ObjectRepository, Selectable } /** - * @param ?int $limit - * @param ?int $offset + * @param array $criteria + * @param array|null $orderBy + * @param ?int $limit + * @param ?int $offset * * @return list */ @@ -53,7 +64,12 @@ class EntityRepository implements ObjectRepository, Selectable { } - /** @return ?T */ + /** + * @psalm-param array $criteria + * @psalm-param array|null $orderBy + * + * @return ?T + */ public function findOneBy(array $criteria, ?array $orderBy = null) { } @@ -64,4 +80,11 @@ class EntityRepository implements ObjectRepository, Selectable public function matching(Criteria $criteria) { } + + /** + * @return class-string + */ + public function getClassName() + { + } } diff --git a/stubs/ObjectManager.phpstub b/stubs/ObjectManager.phpstub index 85ede69..0e2ff1e 100644 --- a/stubs/ObjectManager.phpstub +++ b/stubs/ObjectManager.phpstub @@ -18,7 +18,7 @@ interface ObjectManager * * @return Mapping\ClassMetadata * - * @template T + * @template T of object */ public function getClassMetadata(string $className); @@ -27,7 +27,7 @@ interface ObjectManager * * @return ?T * - * @template T + * @template T of object */ public function find(string $className, $id); } diff --git a/stubs/ObjectRepository.phpstub b/stubs/ObjectRepository.phpstub index 0188227..59ac883 100644 --- a/stubs/ObjectRepository.phpstub +++ b/stubs/ObjectRepository.phpstub @@ -12,13 +12,19 @@ interface ObjectRepository public function findAll(); /** - * @param ?int $limit - * @param ?int $offset + * @param array $criteria + * @param string[]|null $orderBy + * @param ?int $limit + * @param ?int $offset * * @return list */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null); - /** @return ?T */ + /** + * @param array $criteria + * + * @return ?T + */ public function findOneBy(array $criteria); }