Skip to content

Commit cab43df

Browse files
committed
Prefixed stubs so that IDEs are not confused
1 parent 1822c4d commit cab43df

10 files changed

+126
-126
lines changed

stubs/DocumentManager.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,50 @@ class DocumentManager implements ObjectManager
1010

1111
/**
1212
* @template T
13-
* @param class-string<T> $documentName
14-
* @param mixed $identifier
15-
* @param integer|null $lockMode
16-
* @param integer|null $lockVersion
17-
* @return T|null
13+
* @phpstan-param class-string<T> $documentName
14+
* @phpstan-param mixed $identifier
15+
* @phpstan-param integer|null $lockMode
16+
* @phpstan-param integer|null $lockVersion
17+
* @phpstan-return T|null
1818
*/
1919
public function find($documentName, $identifier, $lockMode = null, $lockVersion = null);
2020

2121
/**
2222
* @template T
23-
* @param T $document
24-
* @return T
23+
* @phpstan-param T $document
24+
* @phpstan-return T
2525
*/
2626
public function merge($document);
2727

2828
/**
2929
* @template T
30-
* @param class-string<T> $documentName
31-
* @return DocumentRepository<T>
30+
* @phpstan-param class-string<T> $documentName
31+
* @phpstan-return DocumentRepository<T>
3232
*/
3333
public function getRepository($documentName);
3434

3535
/**
3636
* @template T
37-
* @param class-string<T> $documentName
38-
* @param mixed $identifier
39-
* @return T|null
37+
* @phpstan-param class-string<T> $documentName
38+
* @phpstan-param mixed $identifier
39+
* @phpstan-return T|null
4040
*/
4141
public function getReference($documentName, $identifier);
4242

4343
/**
4444
* @template T
45-
* @param class-string<T> $documentName
46-
* @param mixed $identifier
45+
* @phpstan-param class-string<T> $documentName
46+
* @phpstan-param mixed $identifier
4747
*
48-
* @return T|null
48+
* @phpstan-return T|null
4949
*/
5050
public function getPartialReference($documentName, $identifier);
5151

5252
/**
5353
* @template T
54-
* @param T $entity
55-
* @param bool $deep
56-
* @return T
54+
* @phpstan-param T $entity
55+
* @phpstan-param bool $deep
56+
* @phpstan-return T
5757
*/
5858
public function copy($entity, $deep = false);
5959

stubs/DocumentRepository.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,35 @@ class DocumentRepository implements ObjectRepository
1212
{
1313

1414
/**
15-
* @param mixed $id
16-
* @param int|null $lockMode
17-
* @param int|null $lockVersion
18-
* @return TDocumentClass|null
15+
* @phpstan-param mixed $id
16+
* @phpstan-param int|null $lockMode
17+
* @phpstan-param int|null $lockVersion
18+
* @phpstan-return TDocumentClass|null
1919
*/
2020
public function find($id, $lockMode = null, $lockVersion = null);
2121

2222
/**
23-
* @return TDocumentClass[]
23+
* @phpstan-return TDocumentClass[]
2424
*/
2525
public function findAll();
2626

2727
/**
28-
* @param mixed[] $criteria
29-
* @param string[]|null $sort
30-
* @param int|null $limit
31-
* @param int|null $sip
32-
* @return TDocumentClass[]
28+
* @phpstan-param mixed[] $criteria
29+
* @phpstan-param string[]|null $sort
30+
* @phpstan-param int|null $limit
31+
* @phpstan-param int|null $sip
32+
* @phpstan-return TDocumentClass[]
3333
*/
3434
public function findBy(array $criteria, ?array $sort = null, $limit = null, $skip = null);
3535

3636
/**
37-
* @param mixed[] $criteria The criteria.
38-
* @return TDocumentClass|null
37+
* @phpstan-param mixed[] $criteria The criteria.
38+
* @phpstan-return TDocumentClass|null
3939
*/
4040
public function findOneBy(array $criteria);
4141

4242
/**
43-
* @return class-string<TDocumentClass>
43+
* @phpstan-return class-string<TDocumentClass>
4444
*/
4545
public function getClassName();
4646

stubs/EntityManager.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,50 @@ class EntityManager implements EntityManagerInterface
77

88
/**
99
* @template T
10-
* @param class-string<T> $entityName
11-
* @param mixed $id
12-
* @param integer|null $lockMode
13-
* @param integer|null $lockVersion
14-
* @return T|null
10+
* @phpstan-param class-string<T> $entityName
11+
* @phpstan-param mixed $id
12+
* @phpstan-param integer|null $lockMode
13+
* @phpstan-param integer|null $lockVersion
14+
* @phpstan-return T|null
1515
*/
1616
public function find($entityName, $id, $lockMode = null, $lockVersion = null);
1717

1818
/**
1919
* @template T
20-
* @param T $entity
21-
* @return T
20+
* @phpstan-param T $entity
21+
* @phpstan-return T
2222
*/
2323
public function merge($entity);
2424

2525
/**
2626
* @template T
27-
* @param class-string<T> $entityName
28-
* @return EntityRepository<T>
27+
* @phpstan-param class-string<T> $entityName
28+
* @phpstan-return EntityRepository<T>
2929
*/
3030
public function getRepository($entityName);
3131

3232
/**
3333
* @template T
34-
* @param class-string<T> $entityName
35-
* @param mixed $id
36-
* @return T|null
34+
* @phpstan-param class-string<T> $entityName
35+
* @phpstan-param mixed $id
36+
* @phpstan-return T|null
3737
*/
3838
public function getReference($entityName, $id);
3939

4040
/**
4141
* @template T
42-
* @param class-string<T> $entityName
43-
* @param mixed $identifier
42+
* @phpstan-param class-string<T> $entityName
43+
* @phpstan-param mixed $identifier
4444
*
45-
* @return T|null
45+
* @phpstan-return T|null
4646
*/
4747
public function getPartialReference($entityName, $identifier);
4848

4949
/**
5050
* @template T
51-
* @param T $entity
52-
* @param bool $deep
53-
* @return T
51+
* @phpstan-param T $entity
52+
* @phpstan-param bool $deep
53+
* @phpstan-return T
5454
*/
5555
public function copy($entity, $deep = false);
5656

stubs/EntityManagerDecorator.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,50 @@ class EntityManagerDecorator implements EntityManagerInterface
77

88
/**
99
* @template T
10-
* @param class-string<T> $entityName
11-
* @param mixed $id
12-
* @param integer|null $lockMode
13-
* @param integer|null $lockVersion
14-
* @return T|null
10+
* @phpstan-param class-string<T> $entityName
11+
* @phpstan-param mixed $id
12+
* @phpstan-param integer|null $lockMode
13+
* @phpstan-param integer|null $lockVersion
14+
* @phpstan-return T|null
1515
*/
1616
public function find($entityName, $id, $lockMode = null, $lockVersion = null);
1717

1818
/**
1919
* @template T
20-
* @param T $entity
21-
* @return T
20+
* @phpstan-param T $entity
21+
* @phpstan-return T
2222
*/
2323
public function merge($entity);
2424

2525
/**
2626
* @template T
27-
* @param class-string<T> $entityName
28-
* @return EntityRepository<T>
27+
* @phpstan-param class-string<T> $entityName
28+
* @phpstan-return EntityRepository<T>
2929
*/
3030
public function getRepository($entityName);
3131

3232
/**
3333
* @template T
34-
* @param class-string<T> $entityName
35-
* @param mixed $id
36-
* @return T|null
34+
* @phpstan-param class-string<T> $entityName
35+
* @phpstan-param mixed $id
36+
* @phpstan-return T|null
3737
*/
3838
public function getReference($entityName, $id);
3939

4040
/**
4141
* @template T
42-
* @param class-string<T> $entityName
43-
* @param mixed $identifier
42+
* @phpstan-param class-string<T> $entityName
43+
* @phpstan-param mixed $identifier
4444
*
45-
* @return T|null
45+
* @phpstan-return T|null
4646
*/
4747
public function getPartialReference($entityName, $identifier);
4848

4949
/**
5050
* @template T
51-
* @param T $entity
52-
* @param bool $deep
53-
* @return T
51+
* @phpstan-param T $entity
52+
* @phpstan-param bool $deep
53+
* @phpstan-return T
5454
*/
5555
public function copy($entity, $deep = false);
5656

stubs/EntityManagerInterface.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,48 @@ interface EntityManagerInterface extends ObjectManager
1010

1111
/**
1212
* @template T
13-
* @param class-string<T> $className
14-
* @param mixed $id
15-
* @return T|null
13+
* @phpstan-param class-string<T> $className
14+
* @phpstan-param mixed $id
15+
* @phpstan-return T|null
1616
*/
1717
public function find($className, $id);
1818

1919
/**
2020
* @template T
21-
* @param T $object
22-
* @return T
21+
* @phpstan-param T $object
22+
* @phpstan-return T
2323
*/
2424
public function merge($object);
2525

2626
/**
2727
* @template T
28-
* @param class-string<T> $className
29-
* @return ObjectRepository<T>
28+
* @phpstan-param class-string<T> $className
29+
* @phpstan-return ObjectRepository<T>
3030
*/
3131
public function getRepository($className);
3232

3333
/**
3434
* @template T
35-
* @param class-string<T> $entityName
36-
* @param mixed $id
37-
* @return T|null
35+
* @phpstan-param class-string<T> $entityName
36+
* @phpstan-param mixed $id
37+
* @phpstan-return T|null
3838
*/
3939
public function getReference($entityName, $id);
4040

4141
/**
4242
* @template T
43-
* @param class-string<T> $entityName
44-
* @param mixed $identifier
43+
* @phpstan-param class-string<T> $entityName
44+
* @phpstan-param mixed $identifier
4545
*
46-
* @return T|null
46+
* @phpstan-return T|null
4747
*/
4848
public function getPartialReference($entityName, $identifier);
4949

5050
/**
5151
* @template T
52-
* @param T $entity
53-
* @param bool $deep
54-
* @return T
52+
* @phpstan-param T $entity
53+
* @phpstan-param bool $deep
54+
* @phpstan-return T
5555
*/
5656
public function copy($entity, $deep = false);
5757

stubs/EntityRepository.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ class EntityRepository implements ObjectRepository
1212
{
1313

1414
/**
15-
* @param mixed $id
16-
* @param int|null $lockMode
17-
* @param int|null $lockVersion
18-
* @return TEntityClass|null
15+
* @phpstan-param mixed $id
16+
* @phpstan-param int|null $lockMode
17+
* @phpstan-param int|null $lockVersion
18+
* @phpstan-return TEntityClass|null
1919
*/
2020
public function find($id, $lockMode = null, $lockVersion = null);
2121

2222
/**
23-
* @return TEntityClass[]
23+
* @phpstan-return TEntityClass[]
2424
*/
2525
public function findAll();
2626

2727
/**
28-
* @param mixed[] $criteria
29-
* @param string[]|null $orderBy
30-
* @param int|null $limit
31-
* @param int|null $offset
32-
* @return TEntityClass[]
28+
* @phpstan-param mixed[] $criteria
29+
* @phpstan-param string[]|null $orderBy
30+
* @phpstan-param int|null $limit
31+
* @phpstan-param int|null $offset
32+
* @phpstan-return TEntityClass[]
3333
*/
3434
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null);
3535

3636
/**
37-
* @param mixed[] $criteria The criteria.
38-
* @param array|null $orderBy
39-
* @return TEntityClass|null
37+
* @phpstan-param mixed[] $criteria The criteria.
38+
* @phpstan-param array|null $orderBy
39+
* @phpstan-return TEntityClass|null
4040
*/
4141
public function findOneBy(array $criteria, array $orderBy = null);
4242

4343
/**
44-
* @return class-string<TEntityClass>
44+
* @phpstan-return class-string<TEntityClass>
4545
*/
4646
public function getClassName();
4747

4848
/**
49-
* @return class-string<TEntityClass>
49+
* @phpstan-return class-string<TEntityClass>
5050
*/
5151
protected function getEntityName();
5252

stubs/ManagerRegistry.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ interface ManagerRegistry
77

88
/**
99
* @template T
10-
* @param class-string<T> $persistentObject
11-
* @param string $persistentManagerName
12-
* @return ObjectRepository<T>
10+
* @phpstan-param class-string<T> $persistentObject
11+
* @phpstan-param string $persistentManagerName
12+
* @phpstan-return ObjectRepository<T>
1313
*/
1414
public function getRepository($persistentObject, $persistentManagerName = null);
1515

0 commit comments

Comments
 (0)