Skip to content

Commit

Permalink
Identity map cannot contain null value
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi authored and greg0ire committed Jan 20, 2023
1 parent 9857cf9 commit e17bcb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class UnitOfWork implements PropertyChangedListener
* we always take the root class name of the hierarchy.
*
* @var mixed[]
* @psalm-var array<class-string, array<string, object|null>>
* @psalm-var array<class-string, array<string, object>>
*/
private $identityMap = [];

Expand Down Expand Up @@ -3048,7 +3048,7 @@ public function loadCollection(PersistentCollection $collection)
/**
* Gets the identity map of the UnitOfWork.
*
* @psalm-return array<class-string, array<string, object|null>>
* @psalm-return array<class-string, array<string, object>>
*/
public function getIdentityMap()
{
Expand Down
14 changes: 1 addition & 13 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2576,10 +2576,6 @@
</PossiblyUndefinedArrayOffset>
</file>
<file src="lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php">
<PossiblyNullArgument occurrences="2">
<code>$entity</code>
<code>$entity</code>
</PossiblyNullArgument>
<RedundantConditionGivenDocblockType occurrences="1">
<code>$state === UnitOfWork::STATE_DETACHED</code>
</RedundantConditionGivenDocblockType>
Expand Down Expand Up @@ -2865,9 +2861,6 @@
<code>$collectionToUpdate</code>
<code>$em-&gt;getMetadataFactory()</code>
</InvalidArgument>
<InvalidNullableReturnType occurrences="1">
<code>object</code>
</InvalidNullableReturnType>
<InvalidPropertyAssignmentValue occurrences="2">
<code>$this-&gt;entityChangeSets</code>
<code>$this-&gt;entityChangeSets</code>
Expand All @@ -2881,16 +2874,13 @@
<code>$entityState</code>
<code>$entityState</code>
</NoValue>
<NullableReturnStatement occurrences="1">
<code>$this-&gt;identityMap[$rootClassName][$idHash]</code>
</NullableReturnStatement>
<PossiblyInvalidArgument occurrences="1">
<code>$value</code>
</PossiblyInvalidArgument>
<PossiblyInvalidArrayOffset occurrences="1">
<code>$this-&gt;identityMap[$rootClassName]</code>
</PossiblyInvalidArrayOffset>
<PossiblyNullArgument occurrences="13">
<PossiblyNullArgument occurrences="11">
<code>$assoc</code>
<code>$assoc</code>
<code>$assoc</code>
Expand All @@ -2901,8 +2891,6 @@
<code>$collection-&gt;getOwner()</code>
<code>$collectionToDelete-&gt;getMapping()</code>
<code>$collectionToUpdate-&gt;getMapping()</code>
<code>$entity</code>
<code>$entity</code>
<code>$owner</code>
</PossiblyNullArgument>
<PossiblyNullArrayAccess occurrences="2">
Expand Down

0 comments on commit e17bcb2

Please sign in to comment.