Skip to content

Commit

Permalink
Add generics to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed May 24, 2021
1 parent a6577b8 commit 385a749
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,13 @@ public function & getEntityChangeSet($entity)
*
* @param ClassMetadata $class The class descriptor of the entity.
* @param object $entity The entity for which to compute the changes.
* @psalm-param ClassMetadata<T> $class
* @psalm-param T $entity
*
* @return void
*
* @template T of object
*
* @ignore
*/
public function computeChangeSet(ClassMetadata $class, $entity)
Expand Down Expand Up @@ -961,8 +965,12 @@ private function computeAssociationChanges(array $assoc, $value): void
/**
* @param ClassMetadata $class
* @param object $entity
* @psalm-param ClassMetadata<T> $class
* @psalm-param T $entity
*
* @return void
*
* @template T of object
*/
private function persistNew($class, $entity)
{
Expand Down Expand Up @@ -1021,11 +1029,14 @@ private function hasMissingIdsWhichAreForeignKeys(ClassMetadata $class, array $i
*
* @param ClassMetadata $class The class descriptor of the entity.
* @param object $entity The entity for which to (re)calculate the change set.
* @psalm-param ClassMetadata<T> $class
* @psalm-param T $entity
*
* @return void
*
* @throws ORMInvalidArgumentException If the passed entity is not MANAGED.
*
* @template T of object
* @ignore
*/
public function recomputeSingleEntityChangeSet(ClassMetadata $class, $entity)
Expand Down Expand Up @@ -1152,6 +1163,10 @@ private function executeInserts($class)

/**
* @param object $entity
* @psalm-param ClassMetadata<T> $class
* @psalm-param T $entity
*
* @template T of object
*/
private function addToEntityIdentifiersAndEntityMap(ClassMetadata $class, string $oid, $entity): void
{
Expand Down Expand Up @@ -2032,10 +2047,15 @@ private function doMerge(
/**
* @param object $entity
* @param object $managedCopy
* @psalm-param ClassMetadata<T> $class
* @psalm-param T $entity
* @psalm-param T $managedCopy
*
* @return void
*
* @throws OptimisticLockException
*
* @template T of object
*/
private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy)
{
Expand Down

0 comments on commit 385a749

Please sign in to comment.