Skip to content

Commit 8b7c1eb

Browse files
lSimulmibk
authored andcommitted
Add template annotations
Thanks to these @templates PHPStan no longer needs stub file.
1 parent 186ee71 commit 8b7c1eb

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

LeanMapperQuery/Entity.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ abstract class Entity extends LeanMapper\Entity
3030
/** @var array */
3131
protected static $magicMethodsPrefixes = [];
3232

33+
/**
34+
* @template T of Entity
35+
* @param string $field
36+
* @param IQuery<T> $query
37+
* @return T[]
38+
*/
3339
protected function queryProperty($field, IQuery $query)
3440
{
3541
return static::queryEntityProperty($this, $field, $query);

LeanMapperQuery/IQuery.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
/**
1515
* @author Michal Bohuslávek
1616
* @deprecated use Query instead; the IQuery interface might get removed in the future
17+
*
18+
* @template T of Entity
1719
*/
1820
interface IQuery
1921
{

LeanMapperQuery/Query.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
/**
2525
* @author Michal Bohuslávek
2626
*
27+
* @template T of Entity
28+
*
2729
* @method $this where($cond, ...$args)
2830
* @method $this orderBy($field)
2931
* @method $this asc(bool $asc = true)

0 commit comments

Comments
 (0)