diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php index a26d52de50..260a78afd3 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Filename.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class Filename extends AbstractField { - public function __construct(?string $name = 'filename') + public function __construct() { - parent::__construct($name, 'string', false, [], null, true); + parent::__construct('filename', 'string', false, [], null, true); } } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php index a0d9b6a961..b960ae29bc 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Length.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class Length extends AbstractField { - public function __construct(?string $name = 'length') + public function __construct() { - parent::__construct($name, 'int', false, [], null, true); + parent::__construct('length', 'int', false, [], null, true); } } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php index 7a77d8399e..e2d337f87b 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/Metadata.php @@ -32,7 +32,6 @@ final class Metadata extends AbstractField public $defaultDiscriminatorValue; public function __construct( - ?string $name = 'metadata', bool $nullable = false, array $options = [], ?string $strategy = null, @@ -42,7 +41,7 @@ public function __construct( ?array $discriminatorMap = null, ?string $defaultDiscriminatorValue = null ) { - parent::__construct($name, ClassMetadata::ONE, $nullable, $options, $strategy, $notSaved); + parent::__construct('metadata', ClassMetadata::ONE, $nullable, $options, $strategy, $notSaved); $this->targetDocument = $targetDocument; $this->discriminatorField = $discriminatorField; diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php index bdea254ae4..1454fe993d 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/File/UploadDate.php @@ -15,8 +15,8 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class UploadDate extends AbstractField { - public function __construct(?string $name = 'uploadDate', string $type = 'date') + public function __construct() { - parent::__construct($name, $type, false, [], null, true); + parent::__construct('uploadDate', 'date', false, [], null, true); } } diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php index cec3c967e0..cd14c42bd7 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php @@ -337,8 +337,6 @@ private function setShardKey(ClassMetadata $class, ODM\ShardKey $shardKey): void * Factory method for the Annotation Driver * * @param string[]|string $paths - * - * @return static */ public static function create($paths = [], ?Reader $reader = null): AnnotationDriver { diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php index 5f32f01ea6..435faac4b6 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeDriver.php @@ -23,8 +23,6 @@ public function __construct(array $paths, ?Reader $reader = null) * Factory method for the Attribute Driver * * @param string[]|string $paths - * - * @return AttributeDriver */ public static function create($paths = [], ?Reader $reader = null): AnnotationDriver { diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Mapping/AttributeDriverTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Mapping/AttributeDriverTest.php index 0bb35301f9..df987b35ed 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Mapping/AttributeDriverTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Mapping/AttributeDriverTest.php @@ -15,8 +15,6 @@ class AttributeDriverTest extends AbstractAnnotationDriverTest { protected function loadDriver(): MappingDriver { - $reader = new AttributeReader(); - - return new AttributeDriver($reader); + return AttributeDriver::create(); } }