diff --git a/.gitignore b/.gitignore index 4de07b2..99d8cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.lock tests/_output studio.json +.idea diff --git a/stubs/EntityRepository.phpstub b/stubs/EntityRepository.phpstub index 0e2c4ba..c132850 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 string + * @psalm-supress PropertyNotSetInConstructor + */ protected $_entityName; - /** @var EntityManagerInterface */ + /** + * @var EntityManagerInterface + * @psalm-supress PropertyNotSetInConstructor + */ protected $_em; - /** @var Mapping\ClassMetadata */ + /** + * @var Mapping\ClassMetadata + * @psalm-supress PropertyNotSetInConstructor + */ protected $_class; /** @param Mapping\ClassMetadata $class */ @@ -64,4 +73,12 @@ class EntityRepository implements ObjectRepository, Selectable public function matching(Criteria $criteria) { } + + /** + * @return QueryBuilder + */ + public function createQueryBuilder($alias, $indexBy = null): QueryBuilder + { + + } } diff --git a/stubs/Query.phpstub b/stubs/Query.phpstub new file mode 100644 index 0000000..ae56fd2 --- /dev/null +++ b/stubs/Query.phpstub @@ -0,0 +1,23 @@ + + * : mixed + * ) + */ + public function getResult($hydrationMode = self::HYDRATE_OBJECT) + { + + } +} diff --git a/stubs/QueryBuilder.phpstub b/stubs/QueryBuilder.phpstub index 43c9a9b..c7bfae2 100644 --- a/stubs/QueryBuilder.phpstub +++ b/stubs/QueryBuilder.phpstub @@ -7,6 +7,7 @@ use Doctrine\ORM\Query\Expr; /** * @psalm-type _WhereExpr=Expr\Base|Expr\Comparison|Expr\Func|string * @psalm-type _SelectExpr=Expr\Func|string + * @template T */ class QueryBuilder { @@ -89,4 +90,13 @@ class QueryBuilder public function orHaving($predicate, ...$predicates): self { } + + + /** + * @return Query + */ + public function getQuery(): Query + { + + } }