Skip to content

Commit 372a27b

Browse files
Vincent Le Henaffvincent-le-henaff
authored andcommitted
+ rebase on newer 2.3.x
1 parent b387bff commit 372a27b

23 files changed

+70
-98
lines changed

lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use function is_array;
2020
use function is_string;
2121
use function substr;
22+
use function trigger_deprecation;
2223

2324
/**
2425
* Fluent interface for building aggregation pipelines.

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use GeoJson\Geometry\Geometry;
1212

1313
use function func_get_args;
14+
use function trigger_deprecation;
1415

1516
/**
1617
* Fluent interface for building aggregation pipelines.
@@ -194,10 +195,10 @@ public function expr(): Expr
194195
/**
195196
* Specify $expr criteria for the current field.
196197
*
197-
* @param array|Aggregation\Expr $expression
198198
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
199-
*
200199
* @see Expr::aggregationExpression()
200+
*
201+
* @param array|Aggregation\Expr $expression
201202
*/
202203
public function aggregationExpression($expression): self
203204
{

lib/Doctrine/ODM/MongoDB/DocumentManager.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,10 @@ public function getClassNameResolver(): ClassNameResolver
279279
* Returns the metadata for a class.
280280
*
281281
* @param string $className The class name.
282-
* @psalm-param class-string<T> $className
283282
*
283+
* @psalm-param class-string<T> $className
284284
* @psalm-return ClassMetadata<T>
285-
*
286285
* @template T of object
287-
*
288286
* @psalm-suppress InvalidReturnType, InvalidReturnStatement see https://github.com/vimeo/psalm/issues/5788
289287
*/
290288
public function getClassMetadata($className): ClassMetadata
@@ -549,11 +547,11 @@ public function unlock(object $document): void
549547
* Gets the repository for a document class.
550548
*
551549
* @param string $className The name of the Document.
552-
* @psalm-param class-string<T> $className
553550
*
554551
* @return DocumentRepository|GridFSRepository|ViewRepository The repository.
555-
* @psalm-return DocumentRepository<T>|GridFSRepository<T>|ViewRepository<T>
556552
*
553+
* @psalm-param class-string<T> $className
554+
* @psalm-return DocumentRepository<T>|GridFSRepository<T>|ViewRepository<T>
557555
* @template T of object
558556
*/
559557
public function getRepository($className)
@@ -567,9 +565,10 @@ public function getRepository($className)
567565
* database.
568566
*
569567
* @param array $options Array of options to be used with batchInsert(), update() and remove()
570-
* @psalm-param CommitOptions $options
571568
*
572569
* @throws MongoDBException
570+
*
571+
* @psalm-param CommitOptions $options
573572
*/
574573
public function flush(array $options = [])
575574
{
@@ -586,10 +585,9 @@ public function flush(array $options = [])
586585
* loads itself on first access.
587586
*
588587
* @param mixed $identifier
589-
* @psalm-param class-string<T> $documentName
590588
*
589+
* @psalm-param class-string<T> $documentName
591590
* @psalm-return T|(T&GhostObjectInterface<T>)
592-
*
593591
* @template T of object
594592
*/
595593
public function getReference(string $documentName, $identifier): object
@@ -657,10 +655,9 @@ public function getPartialReference(string $documentName, $identifier): object
657655
* @param mixed $id
658656
* @param int $lockMode
659657
* @param int $lockVersion
660-
* @psalm-param class-string<T> $className
661658
*
659+
* @psalm-param class-string<T> $className
662660
* @psalm-return T|null
663-
*
664661
* @template T of object
665662
*/
666663
public function find($className, $id, $lockMode = LockMode::NONE, $lockVersion = null): ?object

lib/Doctrine/ODM/MongoDB/Event/PreUpdateEventArgs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Doctrine\ODM\MongoDB\Event;
66

77
use Doctrine\ODM\MongoDB\DocumentManager;
8-
use Doctrine\ODM\MongoDB\UnitOfWork;
98
use InvalidArgumentException;
109

1110
use function get_class;

lib/Doctrine/ODM/MongoDB/Hydrator/HydratorFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,10 @@ public function hydrate(object \$document, array \$data, array \$hints = array()
446446
* Hydrate array of MongoDB document data into the given document object.
447447
*
448448
* @param array<string, mixed> $data
449-
* @psalm-param Hints $hints Any hints to account for during reconstitution/lookup of the document.
450449
*
451450
* @return array<string, mixed>
451+
*
452+
* @psalm-param Hints $hints Any hints to account for during reconstitution/lookup of the document.
452453
*/
453454
public function hydrate(object $document, array $data, array $hints = []): array
454455
{

lib/Doctrine/ODM/MongoDB/Hydrator/HydratorInterface.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Doctrine\ODM\MongoDB\Hydrator;
66

7-
use Doctrine\ODM\MongoDB\UnitOfWork;
8-
97
/**
108
* The HydratorInterface defines methods all hydrator need to implement
119
*
@@ -17,9 +15,10 @@ interface HydratorInterface
1715
* Hydrate array of MongoDB document data into the given document object.
1816
*
1917
* @param array<string, mixed> $data
20-
* @psalm-param Hints $hints
2118
*
2219
* @return array<string, mixed>
20+
*
21+
* @psalm-param Hints $hints
2322
*/
2423
public function hydrate(object $document, array $data, array $hints = []): array;
2524
}

lib/Doctrine/ODM/MongoDB/Iterator/CachingIterator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Countable;
88
use Generator;
9-
use ReturnTypeWillChange;
109
use RuntimeException;
1110
use Traversable;
1211

lib/Doctrine/ODM/MongoDB/Iterator/HydratingIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Doctrine\ODM\MongoDB\UnitOfWork;
99
use Generator;
1010
use Iterator;
11-
use ReturnTypeWillChange;
1211
use RuntimeException;
1312
use Traversable;
1413

@@ -42,6 +41,7 @@ final class HydratingIterator implements Iterator
4241
/**
4342
* @param Traversable<mixed, TValue> $traversable
4443
* @param ClassMetadata<TDocument> $class
44+
*
4545
* @psalm-param Hints $unitOfWorkHints
4646
*/
4747
public function __construct(Traversable $traversable, UnitOfWork $unitOfWork, ClassMetadata $class, array $unitOfWorkHints = [])

lib/Doctrine/ODM/MongoDB/Iterator/UnrewindableIterator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Generator;
88
use LogicException;
9-
use ReturnTypeWillChange;
109
use RuntimeException;
1110
use Traversable;
1211

lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ public function loadMetadataForClass($className, \Doctrine\Persistence\Mapping\C
341341

342342
/**
343343
* @param ClassMetadata<object> $class
344+
*
344345
* @psalm-param FieldMappingConfig $mapping
345346
*/
346347
private function addFieldMapping(ClassMetadata $class, array $mapping): void

0 commit comments

Comments
 (0)