Skip to content

Commit 8c6fc5a

Browse files
authored
Document LockMode enums (#9319)
1 parent 40a2038 commit 8c6fc5a

File tree

7 files changed

+15
-0
lines changed

7 files changed

+15
-0
lines changed

lib/Doctrine/ORM/EntityManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ public function flush($entity = null)
403403
* @param int|null $lockVersion The version of the entity to find when using
404404
* optimistic locking.
405405
* @psalm-param class-string<T> $className
406+
* @psalm-param LockMode::*|null $lockMode
406407
*
407408
* @return object|null The entity instance or NULL if the entity can not be found.
408409
* @psalm-return ?T
@@ -990,6 +991,8 @@ public function hasFilters()
990991
}
991992

992993
/**
994+
* @psalm-param LockMode::* $lockMode
995+
*
993996
* @throws OptimisticLockException
994997
* @throws TransactionRequiredException
995998
*/

lib/Doctrine/ORM/EntityManagerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use DateTimeInterface;
99
use Doctrine\Common\EventManager;
1010
use Doctrine\DBAL\Connection;
11+
use Doctrine\DBAL\LockMode;
1112
use Doctrine\ORM\Internal\Hydration\AbstractHydrator;
1213
use Doctrine\ORM\Proxy\ProxyFactory;
1314
use Doctrine\ORM\Query\Expr;
@@ -237,6 +238,7 @@ public function copy($entity, $deep = false);
237238
* @param object $entity
238239
* @param int $lockMode
239240
* @param int|DateTimeInterface|null $lockVersion
241+
* @psalm-param LockMode::* $lockMode
240242
*
241243
* @return void
242244
*

lib/Doctrine/ORM/EntityRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\Common\Collections\Collection;
99
use Doctrine\Common\Collections\Criteria;
1010
use Doctrine\Common\Collections\Selectable;
11+
use Doctrine\DBAL\LockMode;
1112
use Doctrine\Deprecations\Deprecation;
1213
use Doctrine\Inflector\Inflector;
1314
use Doctrine\Inflector\InflectorFactory;
@@ -164,6 +165,7 @@ public function clear()
164165
* or NULL if no specific lock mode should be used
165166
* during the search.
166167
* @param int|null $lockVersion The lock version.
168+
* @psalm-param LockMode::*|null $lockMode
167169
*
168170
* @return object|null The entity instance or NULL if the entity can not be found.
169171
* @psalm-return ?T

lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,7 @@ public function lock(array $criteria, $lockMode)
15371537
* Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister.
15381538
*
15391539
* @param int|null $lockMode One of the Doctrine\DBAL\LockMode::* constants.
1540+
* @psalm-param LockMode::*|null $lockMode
15401541
*
15411542
* @return string
15421543
*/

lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Doctrine\ORM\Persisters\Entity;
66

77
use Doctrine\Common\Collections\Criteria;
8+
use Doctrine\DBAL\LockMode;
89
use Doctrine\ORM\Mapping\ClassMetadata;
910
use Doctrine\ORM\Mapping\MappingException;
1011
use Doctrine\ORM\PersistentCollection;
@@ -54,6 +55,7 @@ public function getInsertSQL();
5455
* @param int|null $limit
5556
* @param int|null $offset
5657
* @param mixed[]|null $orderBy
58+
* @psalm-param LockMode::*|null $lockMode
5759
*
5860
* @return string
5961
*/
@@ -185,6 +187,7 @@ public function getOwningTable($fieldName);
185187
* @psalm-param array<string, mixed> $criteria
186188
* @psalm-param array<string, mixed>|null $assoc
187189
* @psalm-param array<string, mixed> $hints
190+
* @psalm-param LockMode::*|null $lockMode
188191
* @psalm-param array<string, string>|null $orderBy
189192
*
190193
* @return object|null The loaded and managed entity instance or NULL if the entity can not be found.
@@ -239,6 +242,7 @@ public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifie
239242
* @psalm-param array<string, mixed> $id The identifier of the entity as an
240243
* associative array from column or
241244
* field names to values.
245+
* @psalm-param LockMode::*|null $lockMode
242246
*
243247
* @return void
244248
*/
@@ -300,6 +304,7 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC
300304
*
301305
* @param int $lockMode One of the Doctrine\DBAL\LockMode::* constants.
302306
* @psalm-param array<string, mixed> $criteria
307+
* @psalm-param LockMode::* $lockMode
303308
*
304309
* @return void
305310
*/

lib/Doctrine/ORM/Query.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ public function setHydrationMode($hydrationMode): self
751751
* @see \Doctrine\DBAL\LockMode
752752
*
753753
* @param int $lockMode
754+
* @psalm-param LockMode::* $lockMode
754755
*
755756
* @throws TransactionRequiredException
756757
*/

lib/Doctrine/ORM/UnitOfWork.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,6 +2457,7 @@ static function ($assoc) {
24572457
*
24582458
* @param object $entity
24592459
* @param int|DateTimeInterface|null $lockVersion
2460+
* @psalm-param LockMode::* $lockMode
24602461
*
24612462
* @throws ORMInvalidArgumentException
24622463
* @throws TransactionRequiredException

0 commit comments

Comments
 (0)