Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identity map cannot contains null value #10156

Merged
merged 1 commit into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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