Skip to content

Commit 9746da5

Browse files
+ applied vendor/bin/phpcbf
1 parent a9b8dd6 commit 9746da5

19 files changed

+90
-70
lines changed

lib/Doctrine/ODM/MongoDB/DocumentManager.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,10 @@ public function getClassNameResolver(): ClassNameResolver
279279
* Returns the metadata for a class.
280280
*
281281
* @param string $className The class name.
282-
*
283282
* @psalm-param class-string<T> $className
283+
*
284284
* @psalm-return ClassMetadata<T>
285+
*
285286
* @template T of object
286287
* @psalm-suppress InvalidReturnType, InvalidReturnStatement see https://github.com/vimeo/psalm/issues/5788
287288
*/
@@ -547,11 +548,11 @@ public function unlock(object $document): void
547548
* Gets the repository for a document class.
548549
*
549550
* @param string $className The name of the Document.
551+
* @psalm-param class-string<T> $className
550552
*
551553
* @return DocumentRepository|GridFSRepository|ViewRepository The repository.
552-
*
553-
* @psalm-param class-string<T> $className
554554
* @psalm-return DocumentRepository<T>|GridFSRepository<T>|ViewRepository<T>
555+
*
555556
* @template T of object
556557
*/
557558
public function getRepository($className)
@@ -565,10 +566,9 @@ public function getRepository($className)
565566
* database.
566567
*
567568
* @param array $options Array of options to be used with batchInsert(), update() and remove()
569+
* @psalm-param CommitOptions $options
568570
*
569571
* @throws MongoDBException
570-
*
571-
* @psalm-param CommitOptions $options
572572
*/
573573
public function flush(array $options = [])
574574
{
@@ -585,9 +585,10 @@ public function flush(array $options = [])
585585
* loads itself on first access.
586586
*
587587
* @param mixed $identifier
588-
*
589588
* @psalm-param class-string<T> $documentName
589+
*
590590
* @psalm-return T|(T&GhostObjectInterface<T>)
591+
*
591592
* @template T of object
592593
*/
593594
public function getReference(string $documentName, $identifier): object
@@ -655,9 +656,10 @@ public function getPartialReference(string $documentName, $identifier): object
655656
* @param mixed $id
656657
* @param int $lockMode
657658
* @param int $lockVersion
658-
*
659659
* @psalm-param class-string<T> $className
660+
*
660661
* @psalm-return T|null
662+
*
661663
* @template T of object
662664
*/
663665
public function find($className, $id, $lockMode = LockMode::NONE, $lockVersion = null): ?object

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,9 @@ 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.
449450
*
450451
* @return array<string, mixed>
451-
*
452-
* @psalm-param Hints $hints Any hints to account for during reconstitution/lookup of the document.
453452
*/
454453
public function hydrate(object $document, array $data, array $hints = []): array
455454
{

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ interface HydratorInterface
1515
* Hydrate array of MongoDB document data into the given document object.
1616
*
1717
* @param array<string, mixed> $data
18+
* @psalm-param Hints $hints
1819
*
1920
* @return array<string, mixed>
20-
*
21-
* @psalm-param Hints $hints
2221
*/
2322
public function hydrate(object $document, array $data, array $hints = []): array;
2423
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ final class HydratingIterator implements Iterator
4141
/**
4242
* @param Traversable<mixed, TValue> $traversable
4343
* @param ClassMetadata<TDocument> $class
44-
*
4544
* @psalm-param Hints $unitOfWorkHints
4645
*/
4746
public function __construct(Traversable $traversable, UnitOfWork $unitOfWork, ClassMetadata $class, array $unitOfWorkHints = [])

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

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

342342
/**
343343
* @param ClassMetadata<object> $class
344-
*
345344
* @psalm-param FieldMappingConfig $mapping
346345
*/
347346
private function addFieldMapping(ClassMetadata $class, array $mapping): void

lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionInterface.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function setDirty($dirty);
9292
* Sets the collection's owning document together with the AssociationMapping that
9393
* describes the association between the owner and the elements of the collection.
9494
*
95-
* @return void
96-
*
9795
* @psalm-param FieldMapping $mapping
96+
*
97+
* @return void
9898
*/
9999
public function setOwner(object $document, array $mapping);
100100

@@ -154,17 +154,15 @@ public function getOwner(): ?object;
154154

155155
/**
156156
* @return array
157-
*
158157
* @psalm-return FieldMapping
159158
*/
160159
public function getMapping();
161160

162161
/**
163162
* @return ClassMetadata
163+
* @psalm-return ClassMetadata<T>
164164
*
165165
* @throws MongoDBException
166-
*
167-
* @psalm-return ClassMetadata<T>
168166
*/
169167
public function getTypeClass();
170168

lib/Doctrine/ODM/MongoDB/Proxy/Factory/ProxyFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ public function generateProxyClasses(array $classes): int;
1919
* the given identifier.
2020
*
2121
* @param mixed $identifier
22-
*
2322
* @psalm-param ClassMetadata<T> $metadata
23+
*
2424
* @psalm-return T&GhostObjectInterface<T>
25+
*
2526
* @template T of object
2627
*/
2728
public function getProxy(ClassMetadata $metadata, $identifier): GhostObjectInterface;

lib/Doctrine/ODM/MongoDB/Proxy/Resolver/ProxyManagerClassNameResolver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ public function getRealClass(string $class): string
2828

2929
/**
3030
* @psalm-param class-string<RealClassName>|class-string<ProxyInterface<RealClassName>> $className
31+
*
3132
* @psalm-return class-string<RealClassName>
33+
*
3234
* @psalm-template RealClassName of object
3335
*/
3436
public function resolveClassName(string $className): string

lib/Doctrine/ODM/MongoDB/Query/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,10 @@ public function expr(): Expr
515515
/**
516516
* Specify $expr criteria for the current field.
517517
*
518-
* @param array|Aggregation\Expr $expression
519518
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
520-
*
521519
* @see Aggregation\Expr::aggregationExpression()
520+
*
521+
* @param array|Aggregation\Expr $expression
522522
*/
523523
public function aggregationExpression($expression): self
524524
{

lib/Doctrine/ODM/MongoDB/Repository/AbstractRepositoryFactory.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ abstract class AbstractRepositoryFactory implements RepositoryFactory
2727

2828
/**
2929
* @psalm-param class-string<T> $documentName
30+
*
3031
* @psalm-return DocumentRepository<T>|GridFSRepository<T>|ViewRepository<T>
32+
*
3133
* @template T of object
3234
*/
3335
public function getRepository(DocumentManager $documentManager, string $documentName): ObjectRepository
@@ -49,10 +51,11 @@ public function getRepository(DocumentManager $documentManager, string $document
4951
/**
5052
* Create a new repository instance for a document class.
5153
*
52-
* @return DocumentRepository|GridFSRepository|ViewRepository
53-
*
5454
* @psalm-param class-string<T> $documentName
55+
*
56+
* @return DocumentRepository|GridFSRepository|ViewRepository
5557
* @psalm-return DocumentRepository<T>|GridFSRepository<T>|ViewRepository<T>
58+
*
5659
* @template T of object
5760
*/
5861
protected function createRepository(DocumentManager $documentManager, string $documentName): ObjectRepository
@@ -101,10 +104,10 @@ protected function createRepository(DocumentManager $documentManager, string $do
101104
* Instantiates requested repository.
102105
*
103106
* @param ClassMetadata<T> $metadata
107+
* @psalm-param class-string<T> $repositoryClassName
104108
*
105109
* @return ObjectRepository<T>
106110
*
107-
* @psalm-param class-string<T> $repositoryClassName
108111
* @template T of object
109112
*/
110113
abstract protected function instantiateRepository(string $repositoryClassName, DocumentManager $documentManager, ClassMetadata $metadata): ObjectRepository;

0 commit comments

Comments
 (0)