diff --git a/lib/Doctrine/ODM/MongoDB/Configuration.php b/lib/Doctrine/ODM/MongoDB/Configuration.php index 3002f2b26..adc486991 100644 --- a/lib/Doctrine/ODM/MongoDB/Configuration.php +++ b/lib/Doctrine/ODM/MongoDB/Configuration.php @@ -429,7 +429,7 @@ public function setClassMetadataFactoryName(string $cmfName): void $this->attributes['classMetadataFactoryName'] = $cmfName; } - /** @phpstan-return class-string */ + /** @return class-string */ public function getClassMetadataFactoryName(): string { if (! isset($this->attributes['classMetadataFactoryName'])) { @@ -480,7 +480,7 @@ public function addFilter(string $name, string $className, array $parameters = [ ]; } - /** @phpstan-return class-string|null */ + /** @return class-string|null */ public function getFilterClassName(string $name): ?string { return isset($this->attributes['filters'][$name]) @@ -512,7 +512,7 @@ public function setDefaultDocumentRepositoryClassName(string $className): void $this->attributes['defaultDocumentRepositoryClassName'] = $className; } - /** @phpstan-return class-string> */ + /** @return class-string> */ public function getDefaultDocumentRepositoryClassName(): string { return $this->attributes['defaultDocumentRepositoryClassName'] ?? DocumentRepository::class; @@ -534,7 +534,7 @@ public function setDefaultGridFSRepositoryClassName(string $className): void $this->attributes['defaultGridFSRepositoryClassName'] = $className; } - /** @phpstan-return class-string> */ + /** @return class-string> */ public function getDefaultGridFSRepositoryClassName(): string { return $this->attributes['defaultGridFSRepositoryClassName'] ?? DefaultGridFSRepository::class; diff --git a/lib/Doctrine/ODM/MongoDB/DocumentManager.php b/lib/Doctrine/ODM/MongoDB/DocumentManager.php index 520009300..c14ddf506 100644 --- a/lib/Doctrine/ODM/MongoDB/DocumentManager.php +++ b/lib/Doctrine/ODM/MongoDB/DocumentManager.php @@ -286,10 +286,9 @@ public function getClassNameResolver(): ClassNameResolver /** * Returns the metadata for a class. * - * @param string $className The class name. - * @param class-string $className + * @param class-string $className The class name. * - * @phpstan-return ClassMetadata + * @return ClassMetadata * * @template T of object */ @@ -551,11 +550,9 @@ public function unlock(object $document): void /** * Gets the repository for a document class. * - * @param string $className The name of the Document. - * @param class-string $className + * @param class-string $className The name of the Document. * - * @return DocumentRepository|GridFSRepository|ViewRepository The repository. - * @phpstan-return DocumentRepository|GridFSRepository|ViewRepository + * @return DocumentRepository|GridFSRepository|ViewRepository The repository. * * @template T of object */ @@ -592,7 +589,7 @@ public function flush(array $options = []) * @param mixed $identifier * @param class-string $documentName * - * @phpstan-return T|(T&GhostObjectInterface) + * @return T|(T&GhostObjectInterface) * * @template T of object */ @@ -662,7 +659,7 @@ public function getPartialReference(string $documentName, $identifier): object * @param int $lockVersion * @param class-string $className * - * @phpstan-return T|null + * @return T|null * * @template T of object */ @@ -803,8 +800,7 @@ public function createReference(object $document, array $referenceMapping) * @param ClassMetadata $class Metadata of reference document class. * @phpstan-param FieldMapping $referenceMapping * - * @return array with next structure [{discriminator field} => {discriminator value}] - * @phpstan-return array + * @return array with next structure [{discriminator field} => {discriminator value}] * * @throws MappingException When discriminator map is present and reference class in not registered in it. */ @@ -890,7 +886,7 @@ public function getFilterCollection(): FilterCollection * @param FieldMapping $mapping * @param array|null $data * - * @phpstan-return class-string + * @return class-string */ public function getClassNameForAssociation(array $mapping, $data): string { diff --git a/lib/Doctrine/ODM/MongoDB/Event/OnClassMetadataNotFoundEventArgs.php b/lib/Doctrine/ODM/MongoDB/Event/OnClassMetadataNotFoundEventArgs.php index d57d31acd..f90f2079b 100644 --- a/lib/Doctrine/ODM/MongoDB/Event/OnClassMetadataNotFoundEventArgs.php +++ b/lib/Doctrine/ODM/MongoDB/Event/OnClassMetadataNotFoundEventArgs.php @@ -39,7 +39,7 @@ public function getFoundMetadata(): ?ClassMetadata /** * Retrieve class name for which a failed metadata fetch attempt was executed * - * @phpstan-return class-string + * @return class-string */ public function getClassName(): string { diff --git a/lib/Doctrine/ODM/MongoDB/Iterator/Iterator.php b/lib/Doctrine/ODM/MongoDB/Iterator/Iterator.php index 6fa98ee37..bedeacd49 100644 --- a/lib/Doctrine/ODM/MongoDB/Iterator/Iterator.php +++ b/lib/Doctrine/ODM/MongoDB/Iterator/Iterator.php @@ -10,6 +10,6 @@ */ interface Iterator extends \Iterator { - /** @phpstan-return array */ + /** @return array */ public function toArray(): array; } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php index 9846b5be4..38d2f40b3 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php @@ -1315,10 +1315,7 @@ public function isSharded(): bool return $this->shardKey !== []; } - /** - * @return array|object|null - * @phpstan-return array|object|null - */ + /** @return array|object|null */ public function getValidator() { return $this->validator; @@ -1438,7 +1435,7 @@ public function getReflectionProperty(string $name): ReflectionProperty return $this->reflFields[$name]; } - /** @phpstan-return class-string */ + /** @return class-string */ public function getName(): string { return $this->name; @@ -1928,7 +1925,7 @@ public function getFieldMapping(string $fieldName): array /** * Gets mappings of fields holding embedded document(s). * - * @phpstan-return array + * @return array */ public function getEmbeddedFieldsMappings(): array { @@ -2192,7 +2189,7 @@ public function getTypeOfField($fieldName): ?string /** * @param string $assocName * - * @phpstan-return class-string|null + * @return class-string|null */ public function getAssociationTargetClass($assocName): ?string { @@ -2206,7 +2203,7 @@ public function getAssociationTargetClass($assocName): ?string /** * Retrieve the collectionClass associated with an association * - * @phpstan-return class-string + * @return class-string */ public function getAssociationCollectionClass(string $assocName): string { diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php index ec36db726..9035101f9 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php @@ -800,7 +800,7 @@ private function setShardKey(ClassMetadata $class, SimpleXMLElement $xmlShardkey * * list($readPreference, $tags) = $this->transformReadPreference($xml->{read-preference}); * - * @phpstan-return array{string, array>|null} + * @return array{string, array>|null} */ private function transformReadPreference(SimpleXMLElement $xmlReadPreference): array { diff --git a/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionFactory.php b/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionFactory.php index 2f4e0209a..672859788 100644 --- a/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionFactory.php +++ b/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionFactory.php @@ -18,10 +18,10 @@ interface PersistentCollectionFactory /** * Creates specified persistent collection to work with given collection class. * + * @param BaseCollection|null $coll * @phpstan-param FieldMapping $mapping - * @phpstan-param BaseCollection|null $coll * - * @phpstan-return PersistentCollectionInterface + * @return PersistentCollectionInterface */ public function create(DocumentManager $dm, array $mapping, ?BaseCollection $coll = null): PersistentCollectionInterface; } diff --git a/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php b/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php index d09595a4c..e2ddfcca7 100644 --- a/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php +++ b/lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php @@ -471,11 +471,11 @@ public function refresh(object $document): void * * @param array|scalar|ObjectId|null $criteria Query criteria * @param array>|null $sort + * @param T|null $document * @phpstan-param SortShape|null $sort * @phpstan-param Hints $hints - * @phpstan-param T|null $document * - * @phpstan-return T|null + * @return T|null * * @throws LockException * diff --git a/lib/Doctrine/ODM/MongoDB/Proxy/Factory/ProxyFactory.php b/lib/Doctrine/ODM/MongoDB/Proxy/Factory/ProxyFactory.php index b8b84a6fc..1540e40e9 100644 --- a/lib/Doctrine/ODM/MongoDB/Proxy/Factory/ProxyFactory.php +++ b/lib/Doctrine/ODM/MongoDB/Proxy/Factory/ProxyFactory.php @@ -19,7 +19,7 @@ public function generateProxyClasses(array $classes): int; * @param mixed $identifier * @phpstan-param ClassMetadata $metadata * - * @phpstan-return T&GhostObjectInterface + * @return T&GhostObjectInterface * * @template T of object */ diff --git a/lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php b/lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php index 74865900c..13fd4bd3e 100644 --- a/lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php +++ b/lib/Doctrine/ODM/MongoDB/Proxy/Factory/StaticProxyFactory.php @@ -40,7 +40,7 @@ public function __construct(DocumentManager $documentManager) * @param mixed $identifier * @phpstan-param ClassMetadata $metadata * - * @phpstan-return T&GhostObjectInterface + * @return T&GhostObjectInterface * * @template T of object */ diff --git a/lib/Doctrine/ODM/MongoDB/Repository/DefaultGridFSRepository.php b/lib/Doctrine/ODM/MongoDB/Repository/DefaultGridFSRepository.php index 9ab2effc9..030fb112f 100644 --- a/lib/Doctrine/ODM/MongoDB/Repository/DefaultGridFSRepository.php +++ b/lib/Doctrine/ODM/MongoDB/Repository/DefaultGridFSRepository.php @@ -86,7 +86,7 @@ private function getDocumentBucket(): Bucket } /** - * @phpstan-return array{ + * @return array{ * _id?: mixed, * chunkSizeBytes?: int, * metadata?: object diff --git a/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php b/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php index b27653c88..c620883ab 100644 --- a/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php +++ b/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php @@ -105,7 +105,7 @@ public function clear(): void * * @param mixed $id Identifier. * - * @phpstan-return T|null + * @return T|null * * @throws MappingException * @throws LockException @@ -185,14 +185,14 @@ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $ * @param array $criteria * * @return object|null The object. - * @phpstan-return T|null + * @return T|null */ public function findOneBy(array $criteria, ?array $sort = null): ?object { return $this->getDocumentPersister()->load($criteria, null, [], 0, $sort); } - /** @phpstan-return class-string */ + /** @return class-string */ public function getDocumentName(): string { return $this->documentName; @@ -203,13 +203,13 @@ public function getDocumentManager(): DocumentManager return $this->dm; } - /** @phpstan-return ClassMetadata */ + /** @return ClassMetadata */ public function getClassMetadata(): ClassMetadata { return $this->class; } - /** @phpstan-return class-string */ + /** @return class-string */ public function getClassName(): string { return $this->getDocumentName(); @@ -251,7 +251,7 @@ public function matching(Criteria $criteria): ArrayCollection return new ArrayCollection($iterator->toArray()); } - /** @phpstan-return DocumentPersister */ + /** @return DocumentPersister */ protected function getDocumentPersister(): DocumentPersister { return $this->uow->getDocumentPersister($this->documentName); diff --git a/lib/Doctrine/ODM/MongoDB/Repository/RepositoryFactory.php b/lib/Doctrine/ODM/MongoDB/Repository/RepositoryFactory.php index df153d595..24036aa77 100644 --- a/lib/Doctrine/ODM/MongoDB/Repository/RepositoryFactory.php +++ b/lib/Doctrine/ODM/MongoDB/Repository/RepositoryFactory.php @@ -17,7 +17,7 @@ interface RepositoryFactory * * @param class-string $documentName * - * @phpstan-return ObjectRepository + * @return ObjectRepository * * @template T of object */ diff --git a/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php b/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php index e5540d992..d2e74fcee 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php @@ -46,7 +46,7 @@ public function addResolveTargetDocument(string $originalDocument, string $newDo $this->resolveTargetDocuments[$this->getRealClassName($originalDocument)] = $mapping; } - /** @phpstan-return class-string */ + /** @return class-string */ private function getRealClassName(string $className): string { return ltrim($className, '\\'); diff --git a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php index 0c9004435..fc0a93a41 100644 --- a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php +++ b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php @@ -2626,8 +2626,7 @@ public function getVisitedCollections(object $document): array * * @internal * - * @return PersistentCollectionInterface[] - * @phpstan-return array> + * @return array> */ public function getScheduledCollections(object $document): array { @@ -2726,12 +2725,12 @@ public function getOwningDocument(object $document): object /** * Creates a document. Used for reconstitution of documents during hydration. * - * @param array $data * @param class-string $className - * @phpstan-param T|null $document - * @phpstan-param Hints $hints + * @param array $data + * @param T|null $document + * @phpstan-param Hints $hints * - * @phpstan-return T + * @return T * * @template T of object */ @@ -2837,7 +2836,7 @@ public function loadCollection(PersistentCollectionInterface $collection): void * * @internal * - * @phpstan-return array> + * @return array> */ public function getIdentityMap(): array { @@ -2991,7 +2990,7 @@ public function propertyChanged($sender, $propertyName, $oldValue, $newValue) /** * Gets the currently scheduled document insertions in this UnitOfWork. * - * @phpstan-return array + * @return array */ public function getScheduledDocumentInsertions(): array { @@ -3001,7 +3000,7 @@ public function getScheduledDocumentInsertions(): array /** * Gets the currently scheduled document upserts in this UnitOfWork. * - * @phpstan-return array + * @return array */ public function getScheduledDocumentUpserts(): array { @@ -3011,7 +3010,7 @@ public function getScheduledDocumentUpserts(): array /** * Gets the currently scheduled document updates in this UnitOfWork. * - * @phpstan-return array + * @return array */ public function getScheduledDocumentUpdates(): array { @@ -3021,7 +3020,7 @@ public function getScheduledDocumentUpdates(): array /** * Gets the currently scheduled document deletions in this UnitOfWork. * - * @phpstan-return array + * @return array */ public function getScheduledDocumentDeletions(): array { @@ -3033,7 +3032,7 @@ public function getScheduledDocumentDeletions(): array * * @internal * - * @phpstan-return array> + * @return array> */ public function getScheduledCollectionDeletions(): array { @@ -3045,7 +3044,7 @@ public function getScheduledCollectionDeletions(): array * * @internal * - * @phpstan-return array> + * @return array> */ public function getScheduledCollectionUpdates(): array {