diff --git a/docs/en/reference/metadata-drivers.rst b/docs/en/reference/metadata-drivers.rst index b9246488db..f52a2dcb65 100644 --- a/docs/en/reference/metadata-drivers.rst +++ b/docs/en/reference/metadata-drivers.rst @@ -101,14 +101,8 @@ the ``AbstractFileDriver`` implementation for you to extend from: class MyMetadataDriver extends AbstractFileDriver { - /** - * {@inheritdoc} - */ protected $_fileExtension = '.dcm.ext'; - /** - * {@inheritdoc} - */ public function loadMetadataForClass($className, ClassMetadata $metadata) { $data = $this->_loadMappingFile($file); @@ -116,9 +110,6 @@ the ``AbstractFileDriver`` implementation for you to extend from: // populate ClassMetadata instance from $data } - /** - * {@inheritdoc} - */ protected function _loadMappingFile($file) { // parse contents of $file and return php data structure diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractBucket.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractBucket.php index 8f31423c86..9ffedb5b2e 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractBucket.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AbstractBucket.php @@ -57,9 +57,6 @@ public function groupBy($expression): self return $this; } - /** - * {@inheritdoc} - */ public function getExpression(): array { $stage = [ @@ -82,6 +79,11 @@ abstract protected function getExtraPipelineFields(): array; */ abstract protected function getStageName(): string; + /** + * @param array|mixed|string $expression + * + * @return array|mixed|string + */ private function convertExpression($expression) { if (is_array($expression)) { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php index d6d1fcbd0a..7bf77b2b76 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/AddFields.php @@ -9,9 +9,6 @@ */ final class AddFields extends Operator { - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket/AbstractOutput.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket/AbstractOutput.php index 319c790da2..f751c60ab8 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket/AbstractOutput.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Bucket/AbstractOutput.php @@ -29,9 +29,6 @@ public function __construct(Builder $builder, Stage\AbstractBucket $bucket) $this->expr = $builder->expr(); } - /** - * {@inheritdoc} - */ public function getExpression(): array { return $this->expr->getExpression(); diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php index 675d8e4ce5..e4dee55e02 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/CollStats.php @@ -47,9 +47,6 @@ public function showStorageStats(): self return $this; } - /** - * {@inheritdoc} - */ 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 8d8711528e..10ed0bea69 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Count.php @@ -22,9 +22,6 @@ public function __construct(Builder $builder, string $fieldName) $this->fieldName = $fieldName; } - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php index 0d5d8c702d..472e700ac8 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Facet.php @@ -22,9 +22,6 @@ class Facet extends Stage /** @var string */ private $field; - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php index 0f06d489cd..32380690c1 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php @@ -52,9 +52,6 @@ public function __construct(Builder $builder, $x, $y = null) $this->near($x, $y); } - /** - * {@inheritdoc} - */ public function getExpression(): array { $geoNear = [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php index 134f688020..8f8325a091 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php @@ -177,9 +177,6 @@ public function from(string $from): self return $this; } - /** - * {@inheritdoc} - */ public function getExpression(): array { $restrictSearchWithMatch = $this->restrictSearchWithMatch->getExpression() ?: (object) []; @@ -277,6 +274,11 @@ private function fromReference(string $fieldName): self return $this; } + /** + * @param array|mixed|string $expression + * + * @return array|mixed|string + */ private function convertExpression($expression) { if (is_array($expression)) { @@ -290,12 +292,8 @@ private function convertExpression($expression) return Type::convertPHPToDatabaseValue(Expr::convertExpression($expression)); } - private function convertTargetFieldName($fieldName) + private function convertTargetFieldName(string $fieldName): string { - if (is_array($fieldName)) { - return array_map([$this, 'convertTargetFieldName'], $fieldName); - } - if (! $this->targetClass) { return $fieldName; } diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup/MatchStage.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup/MatchStage.php index b079ec7ae0..bdbfeddd76 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup/MatchStage.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup/MatchStage.php @@ -21,9 +21,6 @@ public function __construct(Builder $builder, GraphLookup $graphLookup) $this->graphLookup = $graphLookup; } - /** - * {@inheritdoc} - */ public function getExpression(): array { return $this->query->getQuery(); diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php index 62539d7e5f..88bb883dbe 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Group.php @@ -15,9 +15,6 @@ class Group extends Operator /** @var Expr */ protected $expr; - /** - * {@inheritdoc} - */ public function __construct(Builder $builder) { parent::__construct($builder); @@ -25,9 +22,6 @@ public function __construct(Builder $builder) $this->expr = $builder->expr(); } - /** - * {@inheritdoc} - */ 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 80824572ca..2235f3af38 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/IndexStats.php @@ -12,9 +12,6 @@ */ class IndexStats extends Stage { - /** - * {@inheritdoc} - */ 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 a69bd0975c..4a2408dc1b 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Limit.php @@ -22,9 +22,6 @@ public function __construct(Builder $builder, int $limit) $this->limit = $limit; } - /** - * {@inheritdoc} - */ 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 2eb90812e4..3684facd1e 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php @@ -96,9 +96,6 @@ public function from(string $from): self return $this; } - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php index 2042f2cfa6..863099ace1 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php @@ -308,9 +308,6 @@ public function geoWithinPolygon($point1, $point2, $point3, ...$points): self return $this; } - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php index bf8617ff5e..9d9f7b610b 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php @@ -27,9 +27,6 @@ public function __construct(Builder $builder, string $collection, DocumentManage $this->out($collection); } - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php index 52a13f3d41..0b0bbc671f 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Project.php @@ -13,9 +13,6 @@ */ class Project extends Operator { - /** - * {@inheritdoc} - */ 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 125793bd1a..b05dca5baa 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Redact.php @@ -9,9 +9,6 @@ */ class Redact extends Operator { - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php index 0e645ba275..7fd9d7a8cc 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/ReplaceRoot.php @@ -36,9 +36,6 @@ public function __construct(Builder $builder, DocumentManager $documentManager, $this->expression = $expression; } - /** - * {@inheritdoc} - */ public function getExpression(): array { $expression = $this->expression !== null ? $this->convertExpression($this->expression) : $this->expr->getExpression(); @@ -50,6 +47,11 @@ public function getExpression(): array ]; } + /** + * @param array|string|mixed $expression + * + * @return array|string|mixed + */ private function convertExpression($expression) { if (is_array($expression)) { diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php index a44ffebe1b..ce077eee35 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sample.php @@ -22,9 +22,6 @@ public function __construct(Builder $builder, int $size) $this->size = $size; } - /** - * {@inheritdoc} - */ public function getExpression(): array { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php index 0de4d8870b..4f00efd045 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Skip.php @@ -22,9 +22,6 @@ public function __construct(Builder $builder, int $skip) $this->skip = $skip; } - /** - * {@inheritdoc} - */ 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 87850a70bb..a88614a294 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Sort.php @@ -45,9 +45,6 @@ public function __construct(Builder $builder, $fieldName, $order = null) } } - /** - * {@inheritdoc} - */ 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 6a6e3f1aff..0b23d14aad 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/SortByCount.php @@ -29,9 +29,6 @@ public function __construct(Builder $builder, string $fieldName, DocumentManager $this->fieldName = '$' . $documentPersister->prepareFieldName(substr($fieldName, 1)); } - /** - * {@inheritdoc} - */ 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 5026cadc85..3e9f21cb92 100644 --- a/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php +++ b/lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Unwind.php @@ -28,9 +28,6 @@ public function __construct(Builder $builder, string $fieldName) $this->fieldName = $fieldName; } - /** - * {@inheritdoc} - */ public function getExpression(): array { // Fallback behavior for MongoDB < 3.2 diff --git a/lib/Doctrine/ODM/MongoDB/Id/AlnumGenerator.php b/lib/Doctrine/ODM/MongoDB/Id/AlnumGenerator.php index a5483dbf4f..a5d3bf139b 100644 --- a/lib/Doctrine/ODM/MongoDB/Id/AlnumGenerator.php +++ b/lib/Doctrine/ODM/MongoDB/Id/AlnumGenerator.php @@ -65,7 +65,6 @@ public function setChars(string $chars): void $this->chars = $chars; } - /** @inheritDoc */ public function generate(DocumentManager $dm, object $document) { $id = (string) parent::generate($dm, $document); diff --git a/lib/Doctrine/ODM/MongoDB/Id/AutoGenerator.php b/lib/Doctrine/ODM/MongoDB/Id/AutoGenerator.php index 45f9627d2b..c5b3b132ee 100644 --- a/lib/Doctrine/ODM/MongoDB/Id/AutoGenerator.php +++ b/lib/Doctrine/ODM/MongoDB/Id/AutoGenerator.php @@ -12,7 +12,6 @@ */ final class AutoGenerator extends AbstractIdGenerator { - /** @inheritDoc */ public function generate(DocumentManager $dm, object $document) { return new ObjectId(); diff --git a/lib/Doctrine/ODM/MongoDB/Id/IncrementGenerator.php b/lib/Doctrine/ODM/MongoDB/Id/IncrementGenerator.php index df2ffa14aa..e99535b517 100644 --- a/lib/Doctrine/ODM/MongoDB/Id/IncrementGenerator.php +++ b/lib/Doctrine/ODM/MongoDB/Id/IncrementGenerator.php @@ -51,7 +51,6 @@ public function setStartingId(int $startingId): void $this->startingId = $startingId; } - /** @inheritDoc */ public function generate(DocumentManager $dm, object $document) { $className = get_class($document); diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php index ffca91d71b..3fa0af1e5a 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php @@ -769,9 +769,6 @@ public function getReflectionClass(): ReflectionClass return $this->reflClass; } - /** - * {@inheritDoc} - */ public function isIdentifier($fieldName): bool { return $this->identifier === $fieldName; @@ -788,8 +785,6 @@ public function setIdentifier(?string $identifier): void } /** - * {@inheritDoc} - * * Since MongoDB only allows exactly one identifier field * this will always return an array with only one value */ @@ -809,9 +804,6 @@ public function getIdentifierFieldNames(): array return [$this->identifier]; } - /** - * {@inheritDoc} - */ public function hasField($fieldName): bool { return isset($this->fieldMappings[$fieldName]); @@ -1604,8 +1596,6 @@ public function hasEmbed(string $fieldName): bool } /** - * {@inheritDoc} - * * Checks whether the class has a mapped association (embed or reference) with the given field name. */ public function hasAssociation($fieldName): bool @@ -1614,8 +1604,6 @@ public function hasAssociation($fieldName): bool } /** - * {@inheritDoc} - * * Checks whether the class has a mapped reference or embed for the specified field and * is a single valued association. */ @@ -1625,8 +1613,6 @@ public function isSingleValuedAssociation($fieldName): bool } /** - * {@inheritDoc} - * * Checks whether the class has a mapped reference or embed for the specified field and * is a collection valued association. */ @@ -1735,8 +1721,6 @@ public function getIdentifierValue(object $document) } /** - * {@inheritDoc} - * * Since MongoDB only allows exactly one identifier field this is a proxy * to {@see getIdentifierValue()} and returns an array with the identifier * field as a key. @@ -2054,34 +2038,22 @@ public function markViewOf(string $rootClass): void $this->rootClass = $rootClass; } - /** - * {@inheritDoc} - */ public function getFieldNames(): array { return array_keys($this->fieldMappings); } - /** - * {@inheritDoc} - */ public function getAssociationNames(): array { return array_keys($this->associationMappings); } - /** - * {@inheritDoc} - */ public function getTypeOfField($fieldName): ?string { return isset($this->fieldMappings[$fieldName]) ? $this->fieldMappings[$fieldName]['type'] : null; } - /** - * {@inheritDoc} - */ public function getAssociationTargetClass($assocName): ?string { if (! isset($this->associationMappings[$assocName])) { @@ -2107,17 +2079,11 @@ public function getAssociationCollectionClass(string $assocName): string return $this->associationMappings[$assocName]['collectionClass']; } - /** - * {@inheritDoc} - */ public function isAssociationInverseSide($assocName): bool { throw new BadMethodCallException(__METHOD__ . '() is not implemented yet.'); } - /** - * {@inheritDoc} - */ public function getAssociationMappedByTargetField($assocName) { throw new BadMethodCallException(__METHOD__ . '() is not implemented yet.'); diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php index 822159f131..f948ec6c44 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php @@ -83,9 +83,6 @@ protected function initialize(): void $this->initialized = true; } - /** - * {@inheritDoc} - */ protected function onNotFoundMetadata($className) { if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { @@ -99,17 +96,11 @@ protected function onNotFoundMetadata($className) return $eventArgs->getFoundMetadata(); } - /** - * {@inheritDoc} - */ protected function getFqcnFromAlias($namespaceAlias, $simpleClassName): string { return $this->config->getDocumentNamespace($namespaceAlias) . '\\' . $simpleClassName; } - /** - * {@inheritDoc} - */ protected function getDriver() { return $this->driver; @@ -130,9 +121,6 @@ protected function isEntity(ClassMetadataInterface $class): bool return ! $class->isMappedSuperclass && ! $class->isEmbeddedDocument && ! $class->isQueryResultDocument && ! $class->isView(); } - /** - * {@inheritDoc} - */ protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents = []): void { assert($class instanceof ClassMetadata); @@ -221,9 +209,6 @@ protected function validateIdentifier(ClassMetadata $class): void } } - /** - * {@inheritdoc} - */ protected function newClassMetadataInstance($className): ClassMetadata { return new ClassMetadata($className); diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php index 475966b110..ce7a0340ae 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php @@ -48,9 +48,6 @@ public function isTransient($className) return true; } - /** - * {@inheritdoc} - */ public function loadMetadataForClass($className, \Doctrine\Persistence\Mapping\ClassMetadata $metadata): void { assert($metadata instanceof ClassMetadata); diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/SimplifiedXmlDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/SimplifiedXmlDriver.php index 9e2ba03bfe..10ede10622 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/SimplifiedXmlDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/SimplifiedXmlDriver.php @@ -13,9 +13,6 @@ class SimplifiedXmlDriver extends XmlDriver { public const DEFAULT_FILE_EXTENSION = '.mongodb-odm.xml'; - /** - * {@inheritDoc} - */ public function __construct($prefixes, $fileExtension = self::DEFAULT_FILE_EXTENSION) { $locator = new SymfonyFileLocator((array) $prefixes, $fileExtension); diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php index 3d33d86597..7974515b23 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php @@ -71,17 +71,11 @@ class XmlDriver extends FileDriver ], ]; - /** - * {@inheritDoc} - */ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION) { parent::__construct($locator, $fileExtension); } - /** - * {@inheritDoc} - */ public function loadMetadataForClass($className, \Doctrine\Persistence\Mapping\ClassMetadata $metadata) { assert($metadata instanceof ClassMetadata); @@ -670,9 +664,6 @@ private function transformReadPreference(SimpleXMLElement $xmlReadPreference): a return [(string) $xmlReadPreference['mode'], $tags]; } - /** - * {@inheritDoc} - */ protected function loadMappingFile($file): array { $result = []; diff --git a/lib/Doctrine/ODM/MongoDB/PersistentCollection/AbstractPersistentCollectionFactory.php b/lib/Doctrine/ODM/MongoDB/PersistentCollection/AbstractPersistentCollectionFactory.php index c597615624..a572b51cd5 100644 --- a/lib/Doctrine/ODM/MongoDB/PersistentCollection/AbstractPersistentCollectionFactory.php +++ b/lib/Doctrine/ODM/MongoDB/PersistentCollection/AbstractPersistentCollectionFactory.php @@ -14,9 +14,6 @@ */ abstract class AbstractPersistentCollectionFactory implements PersistentCollectionFactory { - /** - * {@inheritdoc} - */ public function create(DocumentManager $dm, array $mapping, ?BaseCollection $coll = null): PersistentCollectionInterface { if ($coll === null) { diff --git a/lib/Doctrine/ODM/MongoDB/PersistentCollection/DefaultPersistentCollectionGenerator.php b/lib/Doctrine/ODM/MongoDB/PersistentCollection/DefaultPersistentCollectionGenerator.php index 1a81fbd6e9..b81afe9f67 100644 --- a/lib/Doctrine/ODM/MongoDB/PersistentCollection/DefaultPersistentCollectionGenerator.php +++ b/lib/Doctrine/ODM/MongoDB/PersistentCollection/DefaultPersistentCollectionGenerator.php @@ -201,9 +201,6 @@ private function generateMethod(ReflectionMethod $method): string return <<name}($parametersString){$this->getMethodReturnType($method)} { \$this->initialize(); diff --git a/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php b/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php index 90bbd1ffea..fcbd70bc26 100644 --- a/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php +++ b/lib/Doctrine/ODM/MongoDB/PersistentCollection/PersistentCollectionTrait.php @@ -102,38 +102,32 @@ trait PersistentCollectionTrait */ private $hints = []; - /** {@inheritdoc} */ public function setDocumentManager(DocumentManager $dm) { $this->dm = $dm; $this->uow = $dm->getUnitOfWork(); } - /** {@inheritdoc} */ public function setMongoData(array $mongoData) { $this->mongoData = $mongoData; } - /** {@inheritdoc} */ public function getMongoData() { return $this->mongoData; } - /** {@inheritdoc} */ public function setHints(array $hints) { $this->hints = $hints; } - /** {@inheritdoc} */ public function getHints() { return $this->hints; } - /** {@inheritdoc} */ public function initialize() { if ($this->initialized || ! $this->mapping) { @@ -190,7 +184,6 @@ private function changed(): void $this->uow->scheduleForSynchronization($this->owner); } - /** {@inheritdoc} */ public function isDirty() { if ($this->isDirty) { @@ -210,20 +203,17 @@ public function isDirty() return false; } - /** {@inheritdoc} */ public function setDirty($dirty) { $this->isDirty = $dirty; } - /** {@inheritdoc} */ public function setOwner(object $document, array $mapping) { $this->owner = $document; $this->mapping = $mapping; } - /** {@inheritdoc} */ public function takeSnapshot() { if ($this->mapping !== null && CollectionHelper::isList($this->mapping['strategy'])) { @@ -238,20 +228,17 @@ public function takeSnapshot() $this->isDirty = false; } - /** {@inheritdoc} */ public function clearSnapshot() { $this->snapshot = []; $this->isDirty = $this->coll->count() !== 0; } - /** {@inheritdoc} */ public function getSnapshot() { return $this->snapshot; } - /** {@inheritdoc} */ public function getDeleteDiff() { return array_udiff_assoc( @@ -263,7 +250,6 @@ static function ($a, $b) { ); } - /** {@inheritdoc} */ public function getDeletedDocuments() { $compare = static function ($a, $b) { @@ -280,7 +266,6 @@ public function getDeletedDocuments() )); } - /** {@inheritdoc} */ public function getInsertDiff() { return array_udiff_assoc( @@ -292,7 +277,6 @@ static function ($a, $b) { ); } - /** {@inheritdoc} */ public function getInsertedDocuments() { $compare = static function ($a, $b) { @@ -309,19 +293,16 @@ public function getInsertedDocuments() )); } - /** {@inheritdoc} */ public function getOwner(): ?object { return $this->owner; } - /** {@inheritdoc} */ public function getMapping() { return $this->mapping; } - /** {@inheritdoc} */ public function getTypeClass() { if ($this->dm === null) { @@ -339,19 +320,16 @@ public function getTypeClass() return $this->dm->getClassMetadata($this->mapping['targetDocument']); } - /** {@inheritdoc} */ public function setInitialized($bool) { $this->initialized = $bool; } - /** {@inheritdoc} */ public function isInitialized() { return $this->initialized; } - /** {@inheritdoc} */ public function first() { $this->initialize(); @@ -359,7 +337,6 @@ public function first() return $this->coll->first(); } - /** {@inheritdoc} */ public function last() { $this->initialize(); @@ -367,17 +344,11 @@ public function last() return $this->coll->last(); } - /** - * {@inheritdoc} - */ public function remove($key) { return $this->doRemove($key, false); } - /** - * {@inheritdoc} - */ public function removeElement($element) { $this->initialize(); @@ -392,9 +363,6 @@ public function removeElement($element) return $removed; } - /** - * {@inheritdoc} - */ public function containsKey($key) { $this->initialize(); @@ -402,9 +370,6 @@ public function containsKey($key) return $this->coll->containsKey($key); } - /** - * {@inheritdoc} - */ public function contains($element) { $this->initialize(); @@ -412,9 +377,6 @@ public function contains($element) return $this->coll->contains($element); } - /** - * {@inheritdoc} - */ public function exists(Closure $p) { $this->initialize(); @@ -422,9 +384,6 @@ public function exists(Closure $p) return $this->coll->exists($p); } - /** - * {@inheritdoc} - */ public function indexOf($element) { $this->initialize(); @@ -432,9 +391,6 @@ public function indexOf($element) return $this->coll->indexOf($element); } - /** - * {@inheritdoc} - */ public function get($key) { $this->initialize(); @@ -442,9 +398,6 @@ public function get($key) return $this->coll->get($key); } - /** - * {@inheritdoc} - */ public function getKeys() { $this->initialize(); @@ -452,9 +405,6 @@ public function getKeys() return $this->coll->getKeys(); } - /** - * {@inheritdoc} - */ public function getValues() { $this->initialize(); @@ -474,25 +424,16 @@ public function count() return $this->coll->count(); } - /** - * {@inheritdoc} - */ public function set($key, $value) { $this->doSet($key, $value, false); } - /** - * {@inheritdoc} - */ public function add($element) { return $this->doAdd($element, false); } - /** - * {@inheritdoc} - */ public function isEmpty() { return $this->initialized ? $this->coll->isEmpty() : $this->count() === 0; @@ -509,9 +450,6 @@ public function getIterator() return $this->coll->getIterator(); } - /** - * {@inheritdoc} - */ public function map(Closure $func) { $this->initialize(); @@ -519,9 +457,6 @@ public function map(Closure $func) return $this->coll->map($func); } - /** - * {@inheritdoc} - */ public function filter(Closure $p) { $this->initialize(); @@ -529,9 +464,6 @@ public function filter(Closure $p) return $this->coll->filter($p); } - /** - * {@inheritdoc} - */ public function forAll(Closure $p) { $this->initialize(); @@ -539,9 +471,6 @@ public function forAll(Closure $p) return $this->coll->forAll($p); } - /** - * {@inheritdoc} - */ public function partition(Closure $p) { $this->initialize(); @@ -549,9 +478,6 @@ public function partition(Closure $p) return $this->coll->partition($p); } - /** - * {@inheritdoc} - */ public function toArray() { $this->initialize(); @@ -559,9 +485,6 @@ public function toArray() return $this->coll->toArray(); } - /** - * {@inheritdoc} - */ public function clear() { if ($this->initialized && $this->isEmpty()) { @@ -593,9 +516,6 @@ public function clear() $this->takeSnapshot(); } - /** - * {@inheritdoc} - */ public function slice($offset, $length = null) { $this->initialize(); @@ -606,6 +526,8 @@ public function slice($offset, $length = null) /** * Called by PHP when this collection is serialized. Ensures that the * internal state of the collection can be reproduced after serialization + * + * @return string[] */ public function __sleep() { @@ -682,17 +604,11 @@ public function current() return $this->coll->current(); } - /** - * Moves the internal iterator position to the next element. - */ public function next() { return $this->coll->next(); } - /** - * {@inheritdoc} - */ public function unwrap() { return $this->coll; diff --git a/lib/Doctrine/ODM/MongoDB/Query/Expr.php b/lib/Doctrine/ODM/MongoDB/Query/Expr.php index afb54dcb07..9a75afcb71 100644 --- a/lib/Doctrine/ODM/MongoDB/Query/Expr.php +++ b/lib/Doctrine/ODM/MongoDB/Query/Expr.php @@ -1436,6 +1436,8 @@ private function convertExpressions(array $query, ?ClassMetadata $classMetadata * returned unmodified. * * @param Expr|mixed $expression + * + * @return array|mixed */ private static function convertExpression($expression, ClassMetadata $classMetadata) { diff --git a/lib/Doctrine/ODM/MongoDB/Query/Query.php b/lib/Doctrine/ODM/MongoDB/Query/Query.php index 7ecdcec025..459d1b2241 100644 --- a/lib/Doctrine/ODM/MongoDB/Query/Query.php +++ b/lib/Doctrine/ODM/MongoDB/Query/Query.php @@ -169,6 +169,8 @@ public function __clone() * The $name parameter may be used to return a specific key from the * internal $query array property. If omitted, the entire array will be * returned. + * + * @return array|mixed */ public function debug(?string $name = null) { diff --git a/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php b/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php index aa31b64c06..9e7da42d79 100644 --- a/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php +++ b/lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php @@ -157,8 +157,6 @@ public function find($id, int $lockMode = LockMode::NONE, ?int $lockVersion = nu /** * Finds all documents in the repository. - * - * {@inheritDoc} */ public function findAll(): array { @@ -167,8 +165,6 @@ public function findAll(): array /** * Finds documents by a set of criteria. - * - * {@inheritDoc} */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/ClearCache/MetadataCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/ClearCache/MetadataCommand.php index 6f6bb8f81d..7cf157398e 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/ClearCache/MetadataCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/ClearCache/MetadataCommand.php @@ -37,7 +37,7 @@ protected function configure() } /** - * @see \Symfony\Component\Console\Command\Command + * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateHydratorsCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateHydratorsCommand.php index a3402b0250..6528b5163b 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateHydratorsCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateHydratorsCommand.php @@ -57,7 +57,7 @@ protected function configure() } /** - * @see Console\Command\Command + * @return int */ protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GeneratePersistentCollectionsCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GeneratePersistentCollectionsCommand.php index 79c86f335a..c1db83504b 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GeneratePersistentCollectionsCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GeneratePersistentCollectionsCommand.php @@ -57,7 +57,7 @@ protected function configure() } /** - * @see Console\Command\Command + * @return int */ protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateProxiesCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateProxiesCommand.php index 0f2acd192d..90f112eb48 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateProxiesCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateProxiesCommand.php @@ -56,7 +56,7 @@ protected function configure() } /** - * @see Console\Command\Command + * @return int */ protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/QueryCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/QueryCommand.php index 3e41b5c4ec..00b02367ff 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/QueryCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/QueryCommand.php @@ -68,7 +68,7 @@ protected function configure() } /** - * @see Console\Command\Command + * @return int */ protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/CreateCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/CreateCommand.php index b3ae07b4e9..213d07df0f 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/CreateCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/CreateCommand.php @@ -40,6 +40,9 @@ protected function configure() ->setDescription('Create databases, collections and indexes for your documents'); } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $create = array_filter($this->createOrder, static function (string $option) use ($input): bool { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php index 8f9a97b286..a17a09e26b 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php @@ -37,6 +37,9 @@ protected function configure() ->setDescription('Drop databases, collections and indexes for your documents'); } + /** + * @return int + */ protected function execute(InputInterface $input, OutputInterface $output) { $drop = array_filter($this->dropOrder, static function (string $option) use ($input): bool { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/ValidateCommand.php b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/ValidateCommand.php index 72552b54f9..c4a4744897 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/ValidateCommand.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/ValidateCommand.php @@ -32,7 +32,7 @@ protected function configure() } /** - * @see \Symfony\Component\Console\Command\Command + * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php b/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php index 9149e130f5..f499cfc6a5 100644 --- a/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php +++ b/lib/Doctrine/ODM/MongoDB/Tools/ResolveTargetDocumentListener.php @@ -30,9 +30,6 @@ class ResolveTargetDocumentListener implements EventSubscriber */ private $resolveTargetDocuments = []; - /** - * {@inheritDoc} - */ public function getSubscribedEvents() { return [ diff --git a/lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php b/lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php index 5dde550c9c..edaac74042 100644 --- a/lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php +++ b/lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php @@ -36,6 +36,11 @@ public static function getDateTime($value): DateTimeInterface )); } + /** + * @param mixed $current + * + * @return DateTimeInterface + */ public function getNextVersion($current) { return new DateTimeImmutable(); diff --git a/lib/Doctrine/ODM/MongoDB/Types/DateType.php b/lib/Doctrine/ODM/MongoDB/Types/DateType.php index 771927b6d7..652544cd82 100644 --- a/lib/Doctrine/ODM/MongoDB/Types/DateType.php +++ b/lib/Doctrine/ODM/MongoDB/Types/DateType.php @@ -114,6 +114,11 @@ public function closureToPHP(): string return 'if ($value === null) { $return = null; } else { $return = \\' . static::class . '::getDateTime($value); }'; } + /** + * @param mixed $current + * + * @return DateTimeInterface + */ public function getNextVersion($current) { return new DateTime(); diff --git a/lib/Doctrine/ODM/MongoDB/Types/Decimal128Type.php b/lib/Doctrine/ODM/MongoDB/Types/Decimal128Type.php index 92f8ec1c1b..1ae53f73bd 100644 --- a/lib/Doctrine/ODM/MongoDB/Types/Decimal128Type.php +++ b/lib/Doctrine/ODM/MongoDB/Types/Decimal128Type.php @@ -36,6 +36,11 @@ public function diff($old, $new) return bcsub($new, $old); } + /** + * @param mixed $current + * + * @return string + */ public function getNextVersion($current) { if ($current === null) { diff --git a/lib/Doctrine/ODM/MongoDB/Types/Type.php b/lib/Doctrine/ODM/MongoDB/Types/Type.php index 496628c5a1..17f2a56d1a 100644 --- a/lib/Doctrine/ODM/MongoDB/Types/Type.php +++ b/lib/Doctrine/ODM/MongoDB/Types/Type.php @@ -256,6 +256,9 @@ public static function getTypesMap(): array return self::$typesMap; } + /** + * @return string + */ public function __toString() { $e = explode('\\', static::class); diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 1543cd4ce7..8ce5f307b9 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -66,8 +66,11 @@ */tests/* + */lib/* + tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php + tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomTypeTest.php diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomTypeTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomTypeTest.php index ccf29dfc3b..4c64181dd0 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomTypeTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomTypeTest.php @@ -54,8 +54,6 @@ class DateCollectionType extends Type /** * Method called by PersistenceBuilder - * - * {@inheritDoc} */ public function convertToDatabaseValue($value) { @@ -76,9 +74,6 @@ public function convertToDatabaseValue($value) return $value; } - /** - * {@inheritDoc} - */ public function convertToPHPValue($value) { if ($value === null) { diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php index c9f227331b..b5b4dcf432 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php @@ -1035,9 +1035,6 @@ final class DocumentPersisterCustomIdType extends Type { use ClosureToPHP; - /** - * {@inheritdoc} - */ public function convertToDatabaseValue($value) { if ($value instanceof ObjectId) { @@ -1051,9 +1048,6 @@ public function convertToDatabaseValue($value) throw self::createException($value); } - /** - * {@inheritdoc} - */ public function convertToPHPValue($value) { if ($value instanceof DocumentPersisterCustomTypedId) {