From b7deae2a2f7de6b73d4b4c05cef262c3223933b0 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 23 Mar 2023 13:01:24 +0100 Subject: [PATCH] Define psalm types for most pipeline stages --- .../ODM/MongoDB/Aggregation/Aggregation.php | 7 +- .../ODM/MongoDB/Aggregation/Builder.php | 3 + lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php | 2 + .../ODM/MongoDB/Aggregation/Stage.php | 4 + .../Aggregation/Stage/AbstractReplace.php | 64 + .../MongoDB/Aggregation/Stage/AddFields.php | 6 + .../MongoDB/Aggregation/Stage/CollStats.php | 8 + .../ODM/MongoDB/Aggregation/Stage/Count.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Densify.php | 21 +- .../ODM/MongoDB/Aggregation/Stage/Facet.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Fill.php | 14 +- .../ODM/MongoDB/Aggregation/Stage/Group.php | 3 + .../MongoDB/Aggregation/Stage/IndexStats.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Limit.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Lookup.php | 52 +- .../ODM/MongoDB/Aggregation/Stage/Merge.php | 19 +- .../ODM/MongoDB/Aggregation/Stage/Out.php | 30 +- .../ODM/MongoDB/Aggregation/Stage/Project.php | 4 + .../ODM/MongoDB/Aggregation/Stage/Redact.php | 5 + .../MongoDB/Aggregation/Stage/ReplaceRoot.php | 65 +- .../MongoDB/Aggregation/Stage/ReplaceWith.php | 15 +- .../ODM/MongoDB/Aggregation/Stage/Sample.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Set.php | 6 + .../ODM/MongoDB/Aggregation/Stage/Skip.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Sort.php | 12 +- .../MongoDB/Aggregation/Stage/SortByCount.php | 2 + .../MongoDB/Aggregation/Stage/UnionWith.php | 14 +- .../MongoDB/Aggregation/Stage/UnsetStage.php | 3 + .../ODM/MongoDB/Aggregation/Stage/Unwind.php | 19 +- phpstan-baseline.neon | 1120 +++++++++++++---- psalm-baseline.xml | 5 - 31 files changed, 1174 insertions(+), 347 deletions(-) create mode 100644 lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractReplace.php diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php index 655de73d29..767539e6ba 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php @@ -17,6 +17,7 @@ use function array_merge; use function assert; +/** @psalm-import-type PipelineExpression from Builder */ final class Aggregation implements IteratorAggregate { private DocumentManager $dm; @@ -25,7 +26,10 @@ final class Aggregation implements IteratorAggregate private Collection $collection; - /** @var array */ + /** + * @var array + * @psalm-var PipelineExpression + */ private array $pipeline; /** @var array */ @@ -36,6 +40,7 @@ final class Aggregation implements IteratorAggregate /** * @param array $pipeline * @param array $options + * @psalm-param PipelineExpression $pipeline */ public function __construct(DocumentManager $dm, ?ClassMetadata $classMetadata, Collection $collection, array $pipeline, array $options = [], bool $rewindable = true) { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php index 38b93aeecf..949694971c 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php @@ -29,6 +29,8 @@ * Fluent interface for building aggregation pipelines. * * @psalm-import-type SortShape from Sort + * @psalm-import-type StageExpression from Stage + * @psalm-type PipelineExpression = list */ class Builder { @@ -269,6 +271,7 @@ public function getAggregation(array $options = []): Aggregation * given. * * @return array> + * @psalm-return PipelineExpression */ // phpcs:enable Squiz.Commenting.FunctionComment.ExtraParamComment public function getPipeline(/* bool $applyFilters = true */): array diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php index fd5133ed5a..060f703199 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php @@ -24,6 +24,8 @@ /** * Fluent interface for building aggregation pipelines. + * + * @psalm-type OperatorExpression = array|object */ class Expr implements GenericOperatorsInterface { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage.php index a1cad26540..67130534a0 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage.php @@ -13,6 +13,9 @@ * Fluent interface for building aggregation pipelines. * * @internal + * + * @psalm-import-type PipelineExpression from Builder + * @psalm-type StageExpression = non-empty-array|object */ abstract class Stage { @@ -186,6 +189,7 @@ public function geoNear($x, $y = null): Stage\GeoNear * Returns the assembled aggregation pipeline * * @return array> + * @psalm-return PipelineExpression */ public function getPipeline(): array { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractReplace.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractReplace.php new file mode 100644 index 0000000000..3603100584 --- /dev/null +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractReplace.php @@ -0,0 +1,64 @@ +dm = $documentManager; + $this->class = $class; + $this->expression = $expression; + } + + private function getDocumentPersister(): DocumentPersister + { + return $this->dm->getUnitOfWork()->getDocumentPersister($this->class->name); + } + + /** @return array|string */ + protected function getReplaceExpression() + { + return $this->expression !== null ? $this->convertExpression($this->expression) : $this->expr->getExpression(); + } + + /** + * @param mixed[]|string|mixed $expression + * + * @return mixed[]|string|mixed + */ + private function convertExpression($expression) + { + if (is_array($expression)) { + return array_map([$this, 'convertExpression'], $expression); + } + + if (is_string($expression) && substr($expression, 0, 1) === '$') { + return '$' . $this->getDocumentPersister()->prepareFieldName(substr($expression, 1)); + } + + return Type::convertPHPToDatabaseValue(Expr::convertExpression($expression)); + } +} diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php index 63e15ed131..b658656bb9 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php @@ -4,11 +4,17 @@ namespace Doctrine\ODM\MongoDB\Aggregation\Stage; +use Doctrine\ODM\MongoDB\Aggregation\Expr; + /** * Fluent interface for adding a $addFields stage to an aggregation pipeline. + * + * @psalm-import-type OperatorExpression from Expr + * @psalm-type AddFieldsStageExpression = array{'$addFields': array} */ final class AddFields extends Operator { + /** @return AddFieldsStageExpression */ public function getExpression(): array { return ['$addFields' => $this->expr->getExpression()]; diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php index 9d787b6429..f184273994 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php @@ -9,6 +9,13 @@ /** * Fluent interface for adding a $collStats stage to an aggregation pipeline. + * + * @psalm-type CollStatsStageExpression = array{ + * '$collStats': array{ + * latencyStats?: array{histograms?: bool}, + * storageStats?: array{}, + * } + * } */ class CollStats extends Stage { @@ -45,6 +52,7 @@ public function showStorageStats(): self return $this; } + /** @psalm-return CollStatsStageExpression */ public function getExpression(): array { $collStats = []; diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php index 647833e373..a8d83d21bc 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php @@ -9,6 +9,8 @@ /** * Fluent interface for adding a $count stage to an aggregation pipeline. + * + * @psalm-type CountStageExpression = array{'$count': string} */ class Count extends Stage { @@ -21,6 +23,7 @@ public function __construct(Builder $builder, string $fieldName) $this->fieldName = $fieldName; } + /** @psalm-return CountStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php index aeb2fdc5c3..5126c924ab 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php @@ -12,6 +12,20 @@ /** * Fluent interface for adding a $densify stage to an aggregation pipeline. + * + * @psalm-type BoundsType = 'full'|'partition'|array{0: int|float|UTCDateTime, 1: int|float|UTCDateTime} + * @psalm-type UnitType = 'year'|'month'|'week'|'day'|'hour'|'minute'|'second'|'millisecond' + * @psalm-type DensifyStageExpression = array{ + * '$densify': object{ + * field: string, + * partitionByFields?: list, + * range?: object{ + * bounds: BoundsType, + * step: int|float, + * unit?: UnitType + * } + * } + * } */ class Densify extends Stage { @@ -37,8 +51,10 @@ public function partitionByFields(string ...$fields): self } /** - * @param array{0: int|float|UTCDateTime, 1: int|float|UTCDateTime}|string $bounds - * @param int|float $step + * @param array|string $bounds + * @param int|float $step + * @psalm-param BoundsType $bounds + * @psalm-param ''|UnitType $unit */ public function range($bounds, $step, string $unit = ''): self { @@ -54,6 +70,7 @@ public function range($bounds, $step, string $unit = ''): self return $this; } + /** @psalm-return DensifyStageExpression */ public function getExpression(): array { $params = (object) ['field' => $this->field]; diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php index 95fbad8560..348f3f19de 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php @@ -13,6 +13,9 @@ /** * Fluent interface for adding a $facet stage to an aggregation pipeline. + * + * @psalm-import-type PipelineExpression from Builder + * @psalm-type FacetStageExpression = array{'$facet': array} */ class Facet extends Stage { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Fill.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Fill.php index 39a1fc4b45..7fd6fccaef 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Fill.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Fill.php @@ -17,7 +17,18 @@ /** * Fluent interface for adding a $fill stage to an aggregation pipeline. * - * @psalm-type SortShape = array + * @psalm-import-type SortDirectionKeywords from Sort + * @psalm-import-type OperatorExpression from Expr + * @psalm-type SortDirection = int|SortDirectionKeywords + * @psalm-type SortShape = array + * @psalm-type FillStageExpression = array{ + * '$fill': array{ + * partitionBy?: string|OperatorExpression, + * partitionByFields?: list, + * sortBy?: SortShape, + * output?: array, + * } + * } */ class Fill extends Stage { @@ -56,6 +67,7 @@ public function partitionByFields(string ...$fields): self * @param array|string $fieldName Field name or array of field/order pairs * @param int|string $order Field order (if one field is specified) * @psalm-param SortShape|string $fieldName + * @psalm-param SortDirection|null $order */ public function sortBy($fieldName, $order = null): self { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php index 88bb883dbe..4e7be5f50e 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php @@ -9,6 +9,8 @@ /** * Fluent interface for adding a $group stage to an aggregation pipeline. + * + * @psalm-type GroupStageExpression = array{'$group': array} */ class Group extends Operator { @@ -22,6 +24,7 @@ public function __construct(Builder $builder) $this->expr = $builder->expr(); } + /** @psalm-return GroupStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php index 2235f3af38..f59e7732fb 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php @@ -9,9 +9,12 @@ /** * Fluent interface for adding a $indexStats stage to an aggregation pipeline. + * + * @psalm-type IndexStatsStageExpression = array{'$indexStats': object} */ class IndexStats extends Stage { + /** @psalm-return IndexStatsStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php index ec2aa15596..8d4cef764a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php @@ -9,6 +9,8 @@ /** * Fluent interface for adding a $limit stage to an aggregation pipeline. + * + * @psalm-type LimitStageExpression = array{'$limit': int} */ class Limit extends Stage { @@ -21,6 +23,7 @@ public function __construct(Builder $builder, int $limit) $this->limit = $limit; } + /** @psalm-return LimitStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php index a241a216f4..e2ad45f63a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php @@ -15,6 +15,19 @@ /** * Fluent interface for building aggregation pipelines. + * + * @psalm-import-type PipelineExpression from Builder + * @psalm-type PipelineParamType = Builder|Stage|PipelineExpression + * @psalm-type LookupStageExpression = array{ + * $lookup: array{ + * from: string, + * 'as'?: string, + * localField?: string, + * foreignField?: string, + * pipeline?: PipelineExpression, + * let?: array, + * } + * } */ class Lookup extends Stage { @@ -32,10 +45,13 @@ class Lookup extends Stage private ?string $as = null; - /** @var array|null */ + /** @var array|null */ private ?array $let = null; - /** @var Builder|array>|null */ + /** + * @var Builder|array>|null + * @psalm-var Builder|PipelineExpression|null + */ private $pipeline = null; private bool $excludeLocalAndForeignField = false; @@ -92,33 +108,40 @@ public function from(string $from): self return $this; } + /** @psalm-return LookupStageExpression */ public function getExpression(): array { - $expression = [ - '$lookup' => [ - 'from' => $this->from, - 'as' => $this->as, - ], + $lookup = [ + 'from' => $this->from, ]; + if ($this->as !== null) { + $lookup['as'] = $this->as; + } + if (! $this->excludeLocalAndForeignField) { - $expression['$lookup']['localField'] = $this->localField; - $expression['$lookup']['foreignField'] = $this->foreignField; + if ($this->localField !== null) { + $lookup['localField'] = $this->localField; + } + + if ($this->foreignField !== null) { + $lookup['foreignField'] = $this->foreignField; + } } if (! empty($this->let)) { - $expression['$lookup']['let'] = $this->let; + $lookup['let'] = $this->let; } if ($this->pipeline !== null) { if ($this->pipeline instanceof Builder) { - $expression['$lookup']['pipeline'] = $this->pipeline->getPipeline(false); + $lookup['pipeline'] = $this->pipeline->getPipeline(false); } else { - $expression['$lookup']['pipeline'] = $this->pipeline; + $lookup['pipeline'] = $this->pipeline; } } - return $expression; + return ['$lookup' => $lookup]; } /** @@ -157,7 +180,7 @@ public function foreignField(string $foreignField): self * Use the variable expressions to access the fields from * the joined collection's documents that are input to the pipeline. * - * @param array $let + * @param array $let */ public function let(array $let): self { @@ -177,6 +200,7 @@ public function let(array $let): self * and then reference the variables in the pipeline stages. * * @param Builder|Stage|array> $pipeline + * @psalm-param PipelineParamType $pipeline */ public function pipeline($pipeline): self { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php index 9ec37dab50..90174c153e 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php @@ -16,8 +16,20 @@ use function is_array; /** + * @psalm-import-type PipelineExpression from Builder * @psalm-type OutputCollection = string|array{db: string, coll: string} - * @psalm-type WhenMatchedParam = Builder|Stage|string|list> + * @psalm-type WhenMatchedType = 'replace'|'keepExisting'|'merge'|'fail'|PipelineExpression + * @psalm-type WhenMatchedParamType = Builder|Stage|WhenMatchedType + * @psalm-type WhenNotMatchedType = 'insert'|'discard'|'fail' + * @psalm-type MergeStageExpression = array{ + * '$merge': object{ + * into: OutputCollection, + * on?: string|list, + * let?: array, + * whenMatched?: WhenMatchedType, + * whenNotMatched?: WhenNotMatchedType, + * } + * } */ class Merge extends Stage { @@ -37,7 +49,7 @@ class Merge extends Stage /** * @var string|array|Builder|Stage - * @psalm-var WhenMatchedParam + * @psalm-var WhenMatchedParamType */ private $whenMatched; @@ -50,6 +62,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager) $this->dm = $documentManager; } + /** @psalm-return MergeStageExpression */ public function getExpression(): array { $params = (object) [ @@ -123,7 +136,7 @@ public function on(string ...$fields): self /** * @param string|array|Builder|Stage $whenMatched - * @psalm-param WhenMatchedParam $whenMatched + * @psalm-param WhenMatchedParamType $whenMatched */ public function whenMatched($whenMatched): self { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php index 05d3dff5eb..0e820f1f6a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php @@ -11,11 +11,21 @@ use Doctrine\ODM\MongoDB\Mapping\MappingException; use Doctrine\Persistence\Mapping\MappingException as BaseMappingException; +use function is_array; + +/** + * @psalm-import-type OutputCollection from Merge + * @psalm-type OutStageExpression = array{'$out': OutputCollection} + */ class Out extends Stage { private DocumentManager $dm; - private string $collection; + /** + * @var array|string + * @psalm-var OutputCollection + */ + private $out; public function __construct(Builder $builder, string $collection, DocumentManager $documentManager) { @@ -28,16 +38,26 @@ public function __construct(Builder $builder, string $collection, DocumentManage public function getExpression(): array { return [ - '$out' => $this->collection, + '$out' => $this->out, ]; } - public function out(string $collection): Stage\Out + /** + * @param string|array $collection + * @psalm-param OutputCollection $collection + */ + public function out($collection): Stage\Out { + if (is_array($collection)) { + $this->out = $collection; + + return $this; + } + try { $class = $this->dm->getClassMetadata($collection); } catch (BaseMappingException $e) { - $this->collection = $collection; + $this->out = $collection; return $this; } @@ -53,6 +73,6 @@ private function fromDocument(ClassMetadata $classMetadata): void throw MappingException::cannotUseShardedCollectionInOutStage($classMetadata->name); } - $this->collection = $classMetadata->getCollection(); + $this->out = $classMetadata->getCollection(); } } diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php index 08e997c53f..76525952a8 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php @@ -10,9 +10,13 @@ /** * Fluent interface for adding a $project stage to an aggregation pipeline. + * + * @psalm-import-type OperatorExpression from Expr + * @psalm-type ProjectStageExpression = array{'$project': array} */ class Project extends Operator { + /** @psalm-return ProjectStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php index b05dca5baa..2ac792bdba 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php @@ -4,8 +4,13 @@ namespace Doctrine\ODM\MongoDB\Aggregation\Stage; +use Doctrine\ODM\MongoDB\Aggregation\Expr; + /** * Fluent interface for adding a $redact stage to an aggregation pipeline. + * + * @psalm-import-type OperatorExpression from Expr + * @psalm-type SetStageExpression = array{'$redact': array} */ class Redact extends Operator { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php index e27598a386..3d25a2a74a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php @@ -4,68 +4,25 @@ namespace Doctrine\ODM\MongoDB\Aggregation\Stage; -use Doctrine\ODM\MongoDB\Aggregation\Builder; use Doctrine\ODM\MongoDB\Aggregation\Expr; -use Doctrine\ODM\MongoDB\DocumentManager; -use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; -use Doctrine\ODM\MongoDB\Persisters\DocumentPersister; -use Doctrine\ODM\MongoDB\Types\Type; -use function array_map; -use function is_array; -use function is_string; -use function substr; - -class ReplaceRoot extends Operator +/** + * @psalm-import-type OperatorExpression from Expr + * @psalm-type ReplaceRootStageExpression = array{ + * '$replaceRoot': array{ + * newRoot: OperatorExpression|string, + * } + * } + */ +class ReplaceRoot extends AbstractReplace { - private DocumentManager $dm; - - private ClassMetadata $class; - - /** @var string|mixed[]|Expr|null */ - private $expression; - - /** @param string|mixed[]|Expr|null $expression */ - public function __construct(Builder $builder, DocumentManager $documentManager, ClassMetadata $class, $expression = null) - { - parent::__construct($builder); - - $this->dm = $documentManager; - $this->class = $class; - $this->expression = $expression; - } - + /** @return ReplaceRootStageExpression */ public function getExpression(): array { - $expression = $this->expression !== null ? $this->convertExpression($this->expression) : $this->expr->getExpression(); - return [ '$replaceRoot' => [ - 'newRoot' => is_array($expression) ? (object) $expression : $expression, + 'newRoot' => $this->getReplaceExpression(), ], ]; } - - /** - * @param mixed[]|string|mixed $expression - * - * @return mixed[]|string|mixed - */ - private function convertExpression($expression) - { - if (is_array($expression)) { - return array_map([$this, 'convertExpression'], $expression); - } - - if (is_string($expression) && substr($expression, 0, 1) === '$') { - return '$' . $this->getDocumentPersister()->prepareFieldName(substr($expression, 1)); - } - - return Type::convertPHPToDatabaseValue(Expr::convertExpression($expression)); - } - - private function getDocumentPersister(): DocumentPersister - { - return $this->dm->getUnitOfWork()->getDocumentPersister($this->class->name); - } } diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceWith.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceWith.php index 7abcadc3c6..317cde3c28 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceWith.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceWith.php @@ -4,14 +4,17 @@ namespace Doctrine\ODM\MongoDB\Aggregation\Stage; -class ReplaceWith extends ReplaceRoot +use Doctrine\ODM\MongoDB\Aggregation\Expr; + +/** + * @psalm-import-type OperatorExpression from Expr + * @psalm-type ReplaceWithStageExpression = array{'$replaceWith': OperatorExpression|string} + */ +class ReplaceWith extends AbstractReplace { + /** @return ReplaceWithStageExpression */ public function getExpression(): array { - $expression = parent::getExpression(); - - return [ - '$replaceWith' => $expression['$replaceRoot']['newRoot'], - ]; + return ['$replaceWith' => $this->getReplaceExpression()]; } } diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php index a60bc0b514..785157d018 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php @@ -9,6 +9,8 @@ /** * Fluent interface for adding a $sample stage to an aggregation pipeline. + * + * @psalm-type SampleStageExpression = array{'$sample': array{size: int}} */ class Sample extends Stage { @@ -21,6 +23,7 @@ public function __construct(Builder $builder, int $size) $this->size = $size; } + /** @psalm-return SampleStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Set.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Set.php index b11f5c16d2..cca5aed345 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Set.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Set.php @@ -4,11 +4,17 @@ namespace Doctrine\ODM\MongoDB\Aggregation\Stage; +use Doctrine\ODM\MongoDB\Aggregation\Expr; + /** * Fluent interface for adding a $set stage to an aggregation pipeline. + * + * @psalm-import-type OperatorExpression from Expr + * @psalm-type SetStageExpression = array{'$set': array} */ final class Set extends Operator { + /** @psalm-return SetStageExpression */ public function getExpression(): array { return ['$set' => $this->expr->getExpression()]; diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php index 062072dd44..89b67e66d0 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php @@ -9,6 +9,8 @@ /** * Fluent interface for adding a $skip stage to an aggregation pipeline. + * + * @psalm-type SkipStageExpression = array{'$skip': int} */ class Skip extends Stage { @@ -21,6 +23,7 @@ public function __construct(Builder $builder, int $skip) $this->skip = $skip; } + /** @return SkipStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php index e10bf3e062..235d753a6a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php @@ -16,8 +16,12 @@ * Fluent interface for adding a $sort stage to an aggregation pipeline. * * @psalm-type SortMetaKeywords = 'textScore'|'indexKey' - * @psalm-type SortMeta = array{"$meta": SortMetaKeywords} - * @psalm-type SortShape = array + * @psalm-type SortDirectionKeywords = 'asc'|'desc' + * @psalm-type SortMeta = array{'$meta': SortMetaKeywords} + * @psalm-type SortShape = array + * @psalm-type SortStageExpression = array{ + * '$sort': array + * } */ class Sort extends Stage { @@ -27,7 +31,8 @@ class Sort extends Stage /** * @param array>|string $fieldName Field name or array of field/order pairs * @param int|string $order Field order (if one field is specified) - * @psalm-param SortShape|string $fieldName + * @psalm-param SortShape|string $fieldName + * @psalm-param int|SortMeta|SortDirectionKeywords|null $order */ public function __construct(Builder $builder, $fieldName, $order = null) { @@ -50,6 +55,7 @@ public function __construct(Builder $builder, $fieldName, $order = null) } } + /** @psalm-return SortStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php index 737675d86d..494b7f845a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php @@ -11,6 +11,7 @@ use function substr; +/** @psalm-type SortByCountStageExpression = array{'$sortByCount': string} */ class SortByCount extends Stage { private string $fieldName; @@ -28,6 +29,7 @@ public function __construct(Builder $builder, string $fieldName, DocumentManager $this->fieldName = '$' . $documentPersister->prepareFieldName(substr($fieldName, 1)); } + /** @psalm-return SortByCountStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php index 491014ca54..945dd9fe72 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php @@ -13,7 +13,14 @@ /** * Fluent interface for adding a $unionWith stage to an aggregation pipeline. * - * @psalm-type Pipeline = Builder|Stage|list> + * @psalm-import-type PipelineExpression from Builder + * @psalm-type PipelineParamType = array|Builder|Stage|PipelineExpression + * @psalm-type UnionWithStageExpression = array{ + * '$unionWith': object{ + * coll: string, + * pipeline?: PipelineExpression, + * } + * } */ class UnionWith extends Stage { @@ -23,7 +30,7 @@ class UnionWith extends Stage /** * @var array|Builder|null - * @psalm-var ?Pipeline + * @psalm-var ?PipelineParamType */ private $pipeline = null; @@ -43,7 +50,7 @@ public function __construct(Builder $builder, DocumentManager $documentManager, /** * @param array|Builder|Stage $pipeline - * @psalm-param Pipeline $pipeline + * @psalm-param PipelineParamType $pipeline */ public function pipeline($pipeline): self { @@ -60,6 +67,7 @@ public function pipeline($pipeline): self return $this; } + /** @psalm-return UnionWithStageExpression */ public function getExpression(): array { $params = (object) ['coll' => $this->collection]; diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnsetStage.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnsetStage.php index 3582481a4e..774b45406a 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnsetStage.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnsetStage.php @@ -13,6 +13,8 @@ /** * Fluent interface for adding an $unset stage to an aggregation pipeline. + * + * @psalm-type UnsetStageExpression = array{'$unset': list} */ class UnsetStage extends Stage { @@ -29,6 +31,7 @@ public function __construct(Builder $builder, DocumentPersister $documentPersist $this->fields = array_values($fields); } + /** @return UnsetStageExpression */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php index dd2ff3dc29..8f1419ca6d 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php @@ -9,6 +9,14 @@ /** * Fluent interface for adding a $unwind stage to an aggregation pipeline. + * + * @psalm-type UnwindStageExpression = array{ + * '$unwind': string|array{ + * path: string, + * includeArrayIndex?: string, + * preserveNullAndEmptyArrays?: bool, + * } + * } */ class Unwind extends Stage { @@ -25,6 +33,7 @@ public function __construct(Builder $builder, string $fieldName) $this->fieldName = $fieldName; } + /** @psalm-return UnwindStageExpression */ public function getExpression(): array { // Fallback behavior for MongoDB < 3.2 @@ -36,12 +45,12 @@ public function getExpression(): array $unwind = ['path' => $this->fieldName]; - foreach (['includeArrayIndex', 'preserveNullAndEmptyArrays'] as $option) { - if (! $this->$option) { - continue; - } + if ($this->includeArrayIndex) { + $unwind['includeArrayIndex'] = $this->includeArrayIndex; + } - $unwind[$option] = $this->$option; + if ($this->preserveNullAndEmptyArrays) { + $unwind['preserveNullAndEmptyArrays'] = $this->preserveNullAndEmptyArrays; } return ['$unwind' => $unwind]; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 30b248edaa..d67a346142 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,246 +1,876 @@ parameters: - ignoreErrors: - # Adding a parameter would be BC-break - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php - - # Making classes final as suggested would be a BC-break - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - paths: - - lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php - - lib/Doctrine/ODM/MongoDB/DocumentManager.php - - # This cannot be solved the way it is, see https://github.com/vimeo/psalm/issues/5788 - - - message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadataFactory\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getMetadataFactory\\(\\) should be compatible with return type \\(Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadataFactory\\\\>\\) of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getMetadataFactory\\(\\)$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/DocumentManager.php - - # The limit option in GeoNear has been removed in MongoDB 4.2 in favor of $limit stage - - - message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php - - - - message: "#DOCTRINE_MONGODB_DATABASE not found\\.$#" - paths: - - tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php - - tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php - - tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php - - tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php - - - - message: "#DOCTRINE_MONGODB_SERVER not found\\.$#" - paths: - - tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php - - - - message: "#^Parameter \\#1 \\$builder of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Facet\\:\\:pipeline\\(\\) expects Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Builder\\|Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage, stdClass given\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/FacetTest.php - - - - message: "#^Expression \"\\$groups\\[0\\]\" on a separate line does not do anything\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FunctionalTest.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php - - - - message: "#^Parameter \\#1 \\$primer of method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Builder\\:\\:prime\\(\\) expects bool\\|\\(callable\\(\\)\\: mixed\\), 1 given\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php - - # Support for doctrine/collections v1 - - - message: '#^Method Doctrine\\ODM\\MongoDB\\PersistentCollection\:\:add\(\) with return type void returns true but should not return anything\.$#' - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Access to offset '.+' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" - count: 12 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:getMapping\\(\\) should return array\\{type\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\} but returns Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$mapping has unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping as its type\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\:\\:\\$mapping \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\) does not accept array\\\\|bool\\|int\\|string\\|null\\>\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # That statement is never reached because DateTimeInterface is either DateTimeImmutable or DateTime - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php - - # These classes are not final - - - message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Expr\\:\\:convertExpression\\(\\) through static::\\.$#" - count: 3 - path: lib/Doctrine/ODM/MongoDB/Query/Expr.php - - - - message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Types\\\\DateType\\:\\:craftDateTime\\(\\) through static::\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Types/DateType.php - - # False positive, the exception is thrown - - - message: "#^Dead catch \\- MongoDB\\\\Driver\\\\Exception\\\\BulkWriteException is never thrown in the try block\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php - - # Properties are not covariant - - - message: "#^PHPDoc type Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php - - - - message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php - - - - message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php - - - - message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php - - # Collection elements cannot be covariant, see https://github.com/doctrine/collections/pull/220 - - - message: "#^Parameter \\#2 \\$projects of class Documents\\\\Developer constructor expects Doctrine\\\\Common\\\\Collections\\\\Collection\\\\|null, Doctrine\\\\Common\\\\Collections\\\\ArrayCollection\\ given\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php - - # When iterating over SimpleXMLElement, we cannot know the key values - - - message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array#" - count: 2 - path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php - - - - message: "#^Parameter \\#2 \\$options of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\\\:\\:addIndex\\(\\) expects array\\{background\\?\\: bool, bits\\?\\: int, default_language\\?\\: string, expireAfterSeconds\\?\\: int, language_override\\?\\: string, min\\?\\: float, max\\?\\: float, name\\?\\: string, \\.\\.\\.\\}, array\\\\|bool\\|float\\|int\\|string\\|null\\>\\|bool\\|float\\|int\\|string\\|null\\> given\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php - - # This is handled by a try-catch block - - - message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" - paths: - - lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php - - lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php - - lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php - - lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php - - lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php - - # $this->mapping['targetDocument'] is class-string - - - message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # complains about types for arguments we do not use/care - - - message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Proxy\\\\Factory\\\\StaticProxyFactory\\:\\:createInitializer\\(\\) should return Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface\\&TDocument of object\\=, string\\=, array\\\\=, Closure\\|null\\=, array\\\\=\\)\\: bool but returns Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface, string, array, mixed, array\\)\\: true\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php - - - - message: "#^Parameter \\#1 \\$initializer of method ProxyManager\\\\Proxy\\\\GhostObjectInterface\\\\:\\:setProxyInitializer\\(\\) expects \\(Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface\\\\=, string\\=, array\\\\=, Closure\\|null\\=, array\\\\=\\)\\: bool\\)\\|null, Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface, string, array, mixed, array\\)\\: true given\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php - - # compatibility layer for doctrine/persistence ^2.4 || ^3.0 - - - message: "#.*#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Event/OnClearEventArgs - - - - message: "#Property .+ is never written, only read.#" - path: tests - - - - message: "#Property .+ is never read, only written.#" - path: tests - - - - message: "#Property .+ is unused.#" - path: tests - - - - message: "#^Parameter \\#4 \\$query of class Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Query constructor expects array\\{distinct\\?\\: string, hint\\?\\: array\\\\|string, limit\\?\\: int, maxTimeMS\\?\\: int, multiple\\?\\: bool, new\\?\\: bool, newObj\\?\\: array\\, query\\?\\: array\\, \\.\\.\\.\\}, array\\{type\\: \\-1\\} given\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php - - - - message: "#^Parameter \\#2 \\$referenceMapping of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:createReference\\(\\) expects array\\{type\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\}, array\\{storeAs\\: 'dbRef'\\} given\\.$#" - count: 1 - path: tests/Doctrine/ODM/MongoDB/Tests/DocumentManagerTest.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$hints \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\) does not accept default value of type array\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$hints has unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints as its type\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\:\\:\\$hints \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\) does not accept array\\\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091 - - - message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:getHints\\(\\) should return array\\ but returns Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php - - # breaking types expected by static analysis to check exceptions - - - message: "#.+mapField\\(\\) expects.+enumType\\: 'Documents81#" - count: 2 - path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataTest.php - - - - message: "#has parameter \\$[^\\s]+ with no value type specified in iterable type array\\.$#" - count: 6 - path: tests/* - - # cannot know that Command::getHelper('documentManager') returns a DocumentManagerHelper - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" - count: 7 - path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/* + ignoreErrors: + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Builder\\:\\:getPipeline\\(\\) should return array\\\\|object\\> but returns array\\\\>\\.$#" + count: 2 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Builder\\:\\:getPipeline\\(\\) should return array\\\\|object\\> but returns non\\-empty\\-array\\\\>\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php + + - + message: "#^Unsafe usage of new static\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\AbstractReplace\\:\\:getReplaceExpression\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractReplace.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Densify\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\DensifyStageExpression\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Densify\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php + + - + message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\DensifyStageExpression is incompatible with native type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Densify.php + + - + message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Lookup\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\LookupStageExpression\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Lookup\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php + + - + message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\LookupStageExpression is incompatible with native type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\MergeStageExpression\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Merge\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php + + - + message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\MergeStageExpression is incompatible with native type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Merge.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:getExpression\\(\\) has invalid return type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWithStageExpression\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:getExpression\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:pipeline\\(\\) has parameter \\$pipeline with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^PHPDoc tag @return with type Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWithStageExpression is incompatible with native type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\UnionWith\\:\\:\\$pipeline type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/UnionWith.php + + - + message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadataFactory\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getMetadataFactory\\(\\) should be compatible with return type \\(Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadataFactory\\\\>\\) of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getMetadataFactory\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/DocumentManager.php + + - + message: "#^Unsafe usage of new static\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/DocumentManager.php + + - + message: "#^Method Doctrine\\\\Persistence\\\\Event\\\\OnClearEventArgs\\\\:\\:__construct\\(\\) invoked with 2 parameters, 1 required\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Event/OnClearEventArgs.php + + - + message: "#^Parameter \\#1 \\$initializer of method ProxyManager\\\\Proxy\\\\GhostObjectInterface\\\\:\\:setProxyInitializer\\(\\) expects \\(Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface\\\\=, string\\=, array\\\\=, Closure\\|null\\=, array\\\\=\\)\\: bool\\)\\|null, Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface, string, array, mixed, array\\)\\: true given\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php + + - + message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, array\\\\|bool\\|string\\> given\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php + + - + message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, non\\-empty\\-array\\\\|string\\|true\\> given\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php + + - + message: "#^Parameter \\#2 \\$options of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\\\:\\:addIndex\\(\\) expects array\\{background\\?\\: bool, bits\\?\\: int, default_language\\?\\: string, expireAfterSeconds\\?\\: int, language_override\\?\\: string, min\\?\\: float, max\\?\\: float, name\\?\\: string, \\.\\.\\.\\}, array\\\\|bool\\|float\\|int\\|string\\|null\\>\\|bool\\|float\\|int\\|string\\|null\\> given\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php + + - + message: "#^Access to offset 'embedded' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Access to offset 'isOwningSide' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 3 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Access to offset 'orphanRemoval' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Access to offset 'reference' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Access to offset 'strategy' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 4 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Access to offset 'targetDocument' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#" + count: 2 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:add\\(\\) with return type void returns true but should not return anything\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:getHints\\(\\) should return array\\ but returns Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:getMapping\\(\\) should return array\\{type\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\} but returns Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$hints \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\) does not accept default value of type array\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$hints has unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints as its type\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$mapping has unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping as its type\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\:\\:\\$hints \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\Hints\\) does not accept array\\\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\:\\:\\$mapping \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\) does not accept array\\\\|bool\\|int\\|string\\|null\\>\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Proxy\\\\Factory\\\\StaticProxyFactory\\:\\:createInitializer\\(\\) should return Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface\\&TDocument of object\\=, string\\=, array\\\\=, Closure\\|null\\=, array\\\\=\\)\\: bool but returns Closure\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface, string, array, mixed, array\\)\\: true\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php + + - + message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Expr\\:\\:convertExpression\\(\\) through static\\:\\:\\.$#" + count: 3 + path: lib/Doctrine/ODM/MongoDB/Query/Expr.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/ClearCache/MetadataCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateHydratorsCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GeneratePersistentCollectionsCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateProxiesCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/QueryCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/AbstractCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperInterface\\:\\:getDocumentManager\\(\\)\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/ValidateCommand.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php + + - + message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Types\\\\DateType\\:\\:craftDateTime\\(\\) through static\\:\\:\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Types/DateType.php + + - + message: "#^Parameter \\#1 \\$builder of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Facet\\:\\:pipeline\\(\\) expects Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Builder\\|Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage, stdClass given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/FacetTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Aggregation\\\\Stage\\\\MatchStageTest\\:\\:testProxiedExprMethods\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/MatchStageTest.php + + - + message: "#^Constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 5 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Constant DOCTRINE_MONGODB_SERVER not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\BaseTest\\:\\:assertArraySubset\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\BaseTest\\:\\:assertArraySubset\\(\\) has parameter \\$subset with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Used constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Used constant DOCTRINE_MONGODB_SERVER not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php + + - + message: "#^Parameter \\#2 \\$referenceMapping of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:createReference\\(\\) expects array\\{type\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\}, array\\{storeAs\\: 'dbRef'\\} given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/DocumentManagerTest.php + + - + message: "#^Constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php + + - + message: "#^Parameter \\#2 \\$projects of class Documents\\\\Developer constructor expects Doctrine\\\\Common\\\\Collections\\\\Collection\\\\|null, Doctrine\\\\Common\\\\Collections\\\\ArrayCollection\\ given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php + + - + message: "#^Used constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\CustomDatabaseTest\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DatabasesTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\DefaultDatabaseTest\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DatabasesTest.php + + - + message: "#^PHPDoc type Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php + + - + message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php + + - + message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php + + - + message: "#^PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\ of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\DocumentPersisterTestDocumentWithReferenceToDocumentWithCustomId\\:\\:\\$documentWithCustomId is never read, only written\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\DocumentPersisterTestDocumentWithReferenceToDocumentWithCustomId\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php + + - + message: "#^Expression \"\\$groups\\[0\\]\" on a separate line does not do anything\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FunctionalTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildObject\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/LifecycleTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentObject\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/LifecycleTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Hierarchy\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/NestedDocumentsTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1058PersistDocument\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1058PersistDocument\\:\\:\\$value is never read, only written\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1058UpsertDocument\\:\\:\\$value is never read, only written\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1058Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1964Document\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1964Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1990Document\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1990Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH1990Document\\:\\:\\$parent is never read, only written\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH1990Test.php + + - + message: "#^Dead catch \\- MongoDB\\\\Driver\\\\Exception\\\\BulkWriteException is never thrown in the try block\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH921Post\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH921Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH921User\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH921Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\GH999Document\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH999Test.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\Ticket\\\\MODM116Parent\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM116Test.php + + - + message: "#^Constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 2 + path: tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php + + - + message: "#^Used constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\AnnotationDriverTestSuper\\:\\:\\$private is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/AbstractAnnotationDriverTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\DocumentSubClass2\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\DocumentSubClass2\\:\\:\\$name is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\DocumentSubClass\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\DocumentSubClass\\:\\:\\$name is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\GridFSChildClass\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\GridFSParentClass\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\MappedSuperclassBase\\:\\:\\$mapped1 is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\MappedSuperclassBase\\:\\:\\$mapped2 is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\MappedSuperclassBase\\:\\:\\$mappedRelated1 is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\MappedSuperclassBase\\:\\:\\$transient is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\TransientBaseClass\\:\\:\\$transient1 is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\TransientBaseClass\\:\\:\\$transient2 is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/BasicInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\LoadEventTestDocument\\:\\:\\$about is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\LoadEventTestDocument\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\LoadEventTestDocument\\:\\:\\$name is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php + + - + message: "#^Parameter \\#1 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\\\:\\:mapField\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, array\\{fieldName\\: 'enum', enumType\\: 'Documents81\\\\\\\\Card'\\} given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataTest.php + + - + message: "#^Parameter \\#1 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\\\:\\:mapField\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, array\\{fieldName\\: 'enum', enumType\\: 'Documents81\\\\\\\\SuitNonBacked'\\} given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataTest.php + + - + message: "#^Property DoctrineGlobal_User\\:\\:\\$email is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php + + - + message: "#^Property DoctrineGlobal_User\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php + + - + message: "#^Property DoctrineGlobal_User\\:\\:\\$username is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/Documents/GlobalNamespaceDocument.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\ShardedCollectionPerClass1\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\ShardedSingleCollInheritance1\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\ShardedSubclass\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Mapping\\\\ShardedSuperclass\\:\\:\\$name is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ShardKeyInheritanceMappingTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Query\\\\BuilderTest\\:\\:testExclude\\(\\) has parameter \\$expected with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Query\\\\BuilderTest\\:\\:testProxiedExprMethods\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php + + - + message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Query\\\\BuilderTest\\:\\:testSelect\\(\\) has parameter \\$expected with no value type specified in iterable type array\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php + + - + message: "#^Parameter \\#1 \\$primer of method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Builder\\:\\:prime\\(\\) expects bool\\|\\(callable\\(\\)\\: mixed\\), 1 given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php + + - + message: "#^Constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 2 + path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php + + - + message: "#^Parameter \\#4 \\$query of class Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Query constructor expects array\\{distinct\\?\\: string, hint\\?\\: array\\\\|string, limit\\?\\: int, maxTimeMS\\?\\: int, multiple\\?\\: bool, new\\?\\: bool, newObj\\?\\: array\\, query\\?\\: array\\, \\.\\.\\.\\}, array\\{type\\: \\-1\\} given\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php + + - + message: "#^Used constant DOCTRINE_MONGODB_DATABASE not found\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\GH297\\\\User\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/GH297/User.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\ResolveTargetDocument\\:\\:\\$embedMany is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\ResolveTargetDocument\\:\\:\\$embedOne is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\ResolveTargetDocument\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\ResolveTargetDocument\\:\\:\\$refMany is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\ResolveTargetDocument\\:\\:\\$refOne is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Tools\\\\TargetDocument\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/Tools/ResolveTargetDocumentListenerTest.php + + - + message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\ArrayTest\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Doctrine/ODM/MongoDB/Tests/UnitOfWorkTest.php + + - + message: "#^Property Documents\\\\Account\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Account.php + + - + message: "#^Property Documents\\\\Address\\:\\:\\$test is unused\\.$#" + count: 1 + path: tests/Documents/Address.php + + - + message: "#^Property Documents\\\\Album\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Album.php + + - + message: "#^Property Documents\\\\Article\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Article.php + + - + message: "#^Property Documents\\\\Bars\\\\Bar\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Bars/Bar.php + + - + message: "#^Property Documents\\\\Category\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Documents/Category.php + + - + message: "#^Property Documents\\\\Developer\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Developer.php + + - + message: "#^Property Documents\\\\Developer\\:\\:\\$name is never read, only written\\.$#" + count: 1 + path: tests/Documents/Developer.php + + - + message: "#^Property Documents\\\\Ecommerce\\\\StockItem\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Ecommerce/StockItem.php + + - + message: "#^Property Documents\\\\Event\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Event.php + + - + message: "#^Property Documents\\\\File\\:\\:\\$chunkSize is never written, only read\\.$#" + count: 1 + path: tests/Documents/File.php + + - + message: "#^Property Documents\\\\File\\:\\:\\$filename is never written, only read\\.$#" + count: 1 + path: tests/Documents/File.php + + - + message: "#^Property Documents\\\\File\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/File.php + + - + message: "#^Property Documents\\\\File\\:\\:\\$length is never written, only read\\.$#" + count: 1 + path: tests/Documents/File.php + + - + message: "#^Property Documents\\\\File\\:\\:\\$uploadDate is never written, only read\\.$#" + count: 1 + path: tests/Documents/File.php + + - + message: "#^Property Documents\\\\FileWithoutChunkSize\\:\\:\\$chunkSize is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutChunkSize.php + + - + message: "#^Property Documents\\\\FileWithoutChunkSize\\:\\:\\$filename is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutChunkSize.php + + - + message: "#^Property Documents\\\\FileWithoutChunkSize\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutChunkSize.php + + - + message: "#^Property Documents\\\\FileWithoutChunkSize\\:\\:\\$length is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutChunkSize.php + + - + message: "#^Property Documents\\\\FileWithoutChunkSize\\:\\:\\$uploadDate is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutChunkSize.php + + - + message: "#^Property Documents\\\\FileWithoutMetadata\\:\\:\\$filename is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutMetadata.php + + - + message: "#^Property Documents\\\\FileWithoutMetadata\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/FileWithoutMetadata.php + + - + message: "#^Property Documents\\\\Functional\\\\FavoritesUser\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Functional/FavoritesUser.php + + - + message: "#^Property Documents\\\\Group\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Group.php + + - + message: "#^Property Documents\\\\Message\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Message.php + + - + message: "#^Property Documents\\\\ProfileNotify\\:\\:\\$profileId is never written, only read\\.$#" + count: 1 + path: tests/Documents/ProfileNotify.php + + - + message: "#^Property Documents\\\\Project\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Project.php + + - + message: "#^Property Documents\\\\SchemaValidated\\:\\:\\$email is unused\\.$#" + count: 1 + path: tests/Documents/SchemaValidated.php + + - + message: "#^Property Documents\\\\SchemaValidated\\:\\:\\$id is unused\\.$#" + count: 1 + path: tests/Documents/SchemaValidated.php + + - + message: "#^Property Documents\\\\SchemaValidated\\:\\:\\$name is unused\\.$#" + count: 1 + path: tests/Documents/SchemaValidated.php + + - + message: "#^Property Documents\\\\SchemaValidated\\:\\:\\$phone is unused\\.$#" + count: 1 + path: tests/Documents/SchemaValidated.php + + - + message: "#^Property Documents\\\\SchemaValidated\\:\\:\\$status is unused\\.$#" + count: 1 + path: tests/Documents/SchemaValidated.php + + - + message: "#^Property Documents\\\\Task\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Task.php + + - + message: "#^Property Documents\\\\Tournament\\\\Participant\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Tournament/Participant.php + + - + message: "#^Property Documents\\\\Tournament\\\\Tournament\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/Tournament/Tournament.php + + - + message: "#^Property Documents\\\\UserName\\:\\:\\$id is never written, only read\\.$#" + count: 1 + path: tests/Documents/UserName.php + + - + message: "#^Property Documents\\\\UserName\\:\\:\\$username is never written, only read\\.$#" + count: 1 + path: tests/Documents/UserName.php + + - + message: "#^Property Documents\\\\UserName\\:\\:\\$viewReference is never written, only read\\.$#" + count: 1 + path: tests/Documents/UserName.php + + - + message: "#^Property Documents\\\\ViewReference\\:\\:\\$referenceOneViewMappedBy is never written, only read\\.$#" + count: 1 + path: tests/Documents/ViewReference.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5579d1ab4a..e76c8e36dc 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5,11 +5,6 @@ IteratorAggregate - - - $fields - - implementsInterface(GridFSRepository::class)]]>