Skip to content

Commit 3514eca

Browse files
authoredMay 8, 2024
Use object check instead of null (#624)
1 parent 162fe00 commit 3514eca

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed
 

‎psalm.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<!-- Psalm equivalent of PHPStan config `treatPhpDocTypesAsCertain: false` -->
1616
<DocblockTypeContradiction errorLevel="suppress"/>
1717
<RedundantConditionGivenDocblockType errorLevel="suppress"/>
18+
<MissingClassConstType errorLevel="suppress"/>
1819
</issueHandlers>
1920
</psalm>

‎src/Collection/AuditedCollection.php

-4
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ public function exists(\Closure $p)
297297
*
298298
* @phpstan-param \Closure(T, TKey):bool $p
299299
* @phpstan-return Collection<TKey, T>
300-
*
301-
* @psalm-suppress MoreSpecificImplementedParamType https://github.com/doctrine/collections/pull/411
302300
*/
303301
#[\ReturnTypeWillChange]
304302
public function filter(\Closure $p)
@@ -341,8 +339,6 @@ public function map(\Closure $func)
341339
*
342340
* @phpstan-param \Closure(TKey, T):bool $p
343341
* @phpstan-return array{0: Collection<TKey, T>, 1: Collection<TKey, T>}
344-
*
345-
* @psalm-suppress MoreSpecificImplementedParamType https://github.com/doctrine/collections/pull/411
346342
*/
347343
#[\ReturnTypeWillChange]
348344
public function partition(\Closure $p)

‎src/EventListener/LogRevisionsListener.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ private function saveRevisionEntityData(EntityManagerInterface $em, ClassMetadat
550550
$data = $entityData[$field] ?? null;
551551
$relatedId = [];
552552

553-
if (null !== $data && $uow->isInIdentityMap($data)) {
553+
if (\is_object($data) && $uow->isInIdentityMap($data)) {
554554
$relatedId = $uow->getEntityIdentifier($data);
555555
}
556556

@@ -744,7 +744,7 @@ private function prepareUpdateData(EntityManagerInterface $em, EntityPersister $
744744

745745
$newValId = null;
746746

747-
if (null !== $newVal) {
747+
if (\is_object($newVal)) {
748748
if (!$uow->isInIdentityMap($newVal)) {
749749
continue;
750750
}

0 commit comments

Comments
 (0)