Skip to content

Commit

Permalink
Identity map cannot contains null value
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Oct 25, 2022
1 parent 0b9c949 commit 6864377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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 @@ -3017,7 +3017,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
36 changes: 4 additions & 32 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.29.0@7ec5ffbd5f68ae03782d7fd33fff0c45a69f95b3">
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<DeprecatedClass occurrences="1">
<code>IterableResult</code>
Expand Down Expand Up @@ -266,19 +266,14 @@
<MissingReturnType occurrences="1">
<code>wrapInTransaction</code>
</MissingReturnType>
<MoreSpecificImplementedParamType occurrences="1">
<code>$className</code>
</MoreSpecificImplementedParamType>
<TooManyArguments occurrences="2">
<code>find</code>
<code>flush</code>
</TooManyArguments>
</file>
<file src="lib/Doctrine/ORM/EntityManager.php">
<ArgumentTypeCoercion occurrences="3">
<code>$className</code>
<ArgumentTypeCoercion occurrences="1">
<code>$connection</code>
<code>$entityName</code>
</ArgumentTypeCoercion>
<DeprecatedMethod occurrences="2">
<code>getMetadataCacheImpl</code>
Expand Down Expand Up @@ -590,12 +585,6 @@
<code>$definition</code>
<code>$this-&gt;subClasses</code>
</InvalidPropertyAssignmentValue>
<InvalidReturnStatement occurrences="1">
<code>$this-&gt;reflClass</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>getReflectionClass</code>
</InvalidReturnType>
<LessSpecificReturnStatement occurrences="4">
<code>$cache</code>
<code>$className</code>
Expand Down Expand Up @@ -986,10 +975,6 @@
</MissingParamType>
</file>
<file src="lib/Doctrine/ORM/Mapping/MappingException.php">
<ArgumentTypeCoercion occurrences="2">
<code>$className</code>
<code>$entityName</code>
</ArgumentTypeCoercion>
<MissingParamType occurrences="4">
<code>$className</code>
<code>$className</code>
Expand Down Expand Up @@ -2498,8 +2483,7 @@
</RedundantConditionGivenDocblockType>
</file>
<file src="lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php">
<InvalidReturnStatement occurrences="2">
<code>$this-&gt;repositoryList[$repositoryHash]</code>
<InvalidReturnStatement occurrences="1">
<code>$this-&gt;repositoryList[$repositoryHash] = $this-&gt;createRepository($entityManager, $entityName)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
Expand Down Expand Up @@ -2692,10 +2676,6 @@
</MissingReturnType>
</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 @@ -2998,9 +2978,6 @@
<InvalidArgument occurrences="1">
<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 @@ -3010,13 +2987,10 @@
<code>$prevManagedCopy</code>
<code>$previousManagedCopy</code>
</MissingParamType>
<NullableReturnStatement occurrences="1">
<code>$this-&gt;identityMap[$rootClassName][$idHash]</code>
</NullableReturnStatement>
<PossiblyInvalidArrayOffset occurrences="1">
<code>$this-&gt;identityMap[$rootClassName]</code>
</PossiblyInvalidArrayOffset>
<PossiblyNullArgument occurrences="12">
<PossiblyNullArgument occurrences="10">
<code>$assoc</code>
<code>$assoc</code>
<code>$assoc</code>
Expand All @@ -3026,8 +3000,6 @@
<code>$collection-&gt;getOwner()</code>
<code>$collection-&gt;getOwner()</code>
<code>$collectionToDelete-&gt;getMapping()</code>
<code>$entity</code>
<code>$entity</code>
<code>$owner</code>
</PossiblyNullArgument>
<PossiblyNullArrayAccess occurrences="2">
Expand Down

0 comments on commit 6864377

Please sign in to comment.