From 08b99eb891b88755691f8317249dac7ed91dde54 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 10 Dec 2023 09:34:54 +0100 Subject: [PATCH 1/2] Fix criteria mapping type --- .../ODM/MongoDB/Mapping/Annotations/ReferenceMany.php | 4 ++-- .../ODM/MongoDB/Mapping/Annotations/ReferenceOne.php | 4 ++-- lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceMany.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceMany.php index e4262d44a0..a4afe8c9ec 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceMany.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceMany.php @@ -51,7 +51,7 @@ final class ReferenceMany extends AbstractField /** @var array */ public $sort; - /** @var array */ + /** @var array */ public $criteria; /** @var int|null */ @@ -73,7 +73,7 @@ final class ReferenceMany extends AbstractField * @param array|null $discriminatorMap * @param string[]|string|null $cascade * @param array $sort - * @param array $criteria + * @param array $criteria * @param string[] $prime */ public function __construct( diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceOne.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceOne.php index 0602805d7c..7e89191fe8 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceOne.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/ReferenceOne.php @@ -50,7 +50,7 @@ final class ReferenceOne extends AbstractField /** @var array */ public $sort; - /** @var array */ + /** @var array */ public $criteria; /** @var int|null */ @@ -64,7 +64,7 @@ final class ReferenceOne extends AbstractField * @param array|null $discriminatorMap * @param string[]|string|null $cascade * @param array $sort - * @param array $criteria + * @param array $criteria */ public function __construct( ?string $name = null, diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php index d5d5517ee1..cb0d0e08bb 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php @@ -100,7 +100,7 @@ * unique?: bool, * index?: bool, * index-name?: string, - * criteria?: array, + * criteria?: array, * alsoLoadFields?: list, * order?: int|string, * background?: bool, @@ -147,7 +147,7 @@ * sparse?: bool, * unique?: bool, * index?: bool, - * criteria?: array, + * criteria?: array, * alsoLoadFields?: list, * enumType?: class-string, * storeEmptyArray?: bool, @@ -193,7 +193,7 @@ * sparse?: bool, * unique?: bool, * index?: bool, - * criteria?: array, + * criteria?: array, * alsoLoadFields?: list, * storeEmptyArray?: bool, * } From 7f50ed75f177b14705b7aa77bc9afe864188c4b5 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Wed, 28 Feb 2024 23:19:40 +0100 Subject: [PATCH 2/2] Ignore psalm issues These new issues have been reported in https://github.com/vimeo/psalm/issues/10578 --- psalm-baseline.xml | 190 +++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 92 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index a1a8c05353..0f1e7b7a2e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,20 +1,20 @@ - + - IteratorAggregate + - $fieldName - $order + + - $fieldName - $order + + @@ -26,17 +26,17 @@ - ClassMetadataFactoryInterface + - parent::__construct($objectManager, $entityClass) + - TValue|false + @@ -44,11 +44,11 @@ ]]> - $mapping - $mapping - $mapping - $mapping - $mapping + + + + + identifier => $this->getIdentifierValue($object)]]]> @@ -59,36 +59,36 @@ fieldMappings]]> - $mapping + associationMappings, static fn ($assoc) => ! empty($assoc['embedded']) )]]> - FieldMapping + ]]> - array + ]]> - $mapping + - $mapping - $options + + - $mapping - $options + + field]]> @@ -131,7 +131,7 @@ - assert($attributes instanceof SimpleXMLElement) + {'default-discriminator-value'})]]> {'discriminator-field'})]]> {'discriminator-map'})]]> @@ -187,12 +187,12 @@ - array_values + - $className + @@ -209,91 +209,91 @@ - IteratorAggregate + - array + - getDocumentManager + - CommandCompatibility + - getDocumentManager + - getDocumentManager + - getDocumentManager + - getDocumentManager + - getDocumentManager + - getDocumentManager + - DocumentManagerHelperCompatibility + - MetadataFilter + - $newMapping - $newMapping - $newMapping - $newMapping + + + + - $datetime instanceof DateTime + - $assoc - $assoc - $assoc2 - $assoc2 - $mapping - $mapping + + + + + + parentAssociations]]> - $divided + , 1: array}>]]> @@ -301,23 +301,26 @@ + + name])]]> + - Operator + - $documentPersister + - $mapping + $defaultFieldMapping + - FieldMapping + @@ -332,7 +335,7 @@ - new ArrayCollection([$project]) + @@ -349,21 +352,21 @@ - $i - $i - $j - $j + + + + - $phonenumbers - $phonenumbers + + - Iterator + @@ -380,7 +383,7 @@ - assertEmpty + @@ -395,31 +398,31 @@ - assertIsInt + - $colAddToSet - $colAddToSet - $colAddToSet - $colPush - $colPush - $colPush - $colSet - $colSet - $colSet - $colSetArray - $colSetArray - $colSetArray + + + + + + + + + + + + - new ArrayCollection([ + + ])]]> @@ -429,12 +432,12 @@ new GH597Comment('Comment 2'), new GH597Comment('Comment 3'), ])]]> - new ArrayCollection([$referenceMany1, $referenceMany2]) + - $collection + @@ -444,7 +447,7 @@ - DocumentManager + dm]]> @@ -452,8 +455,8 @@ - $config - $mapping + + 'assoc', 'reference' => true, @@ -474,36 +477,39 @@ - 1 + - new IndexInfoIteratorIterator(new ArrayIterator($indexes)) - new IndexInfoIteratorIterator(new ArrayIterator([])) + + - new IndexInfoIteratorIterator(new ArrayIterator($indexes)) - new IndexInfoIteratorIterator(new ArrayIterator([])) + + - $options + $expectedWriteOptions + + + + - assertInstanceOf + - assertInstanceOf + - loadAll - loadAll + +