diff --git a/src/Mapping/Annotation/Blameable.php b/src/Mapping/Annotation/Blameable.php index 2ffa171883..e57294747a 100644 --- a/src/Mapping/Annotation/Blameable.php +++ b/src/Mapping/Annotation/Blameable.php @@ -32,7 +32,7 @@ final class Blameable implements GedmoAnnotation public $field; /** @var mixed */ public $value; - /** @var string|null */ + /** @var string */ public $setterMethod; /** @@ -45,7 +45,7 @@ public function __construct( string $on = 'update', $field = null, $value = null, - ?string $setterMethod = null + string $setterMethod = '' ) { if ([] !== $data) { @trigger_error(sprintf( diff --git a/src/Mapping/Annotation/IpTraceable.php b/src/Mapping/Annotation/IpTraceable.php index b5731eacdf..508591cc49 100644 --- a/src/Mapping/Annotation/IpTraceable.php +++ b/src/Mapping/Annotation/IpTraceable.php @@ -32,7 +32,7 @@ final class IpTraceable implements GedmoAnnotation public $field; /** @var mixed */ public $value; - /** @var string|null */ + /** @var string */ public $setterMethod; /** @@ -45,7 +45,7 @@ public function __construct( string $on = 'update', $field = null, $value = null, - ?string $setterMethod = null + string $setterMethod = '' ) { if ([] !== $data) { @trigger_error(sprintf( diff --git a/src/Mapping/Annotation/SoftDeleteable.php b/src/Mapping/Annotation/SoftDeleteable.php index d226fe1447..79b1e953f7 100644 --- a/src/Mapping/Annotation/SoftDeleteable.php +++ b/src/Mapping/Annotation/SoftDeleteable.php @@ -35,14 +35,19 @@ final class SoftDeleteable implements GedmoAnnotation /** @var bool */ public $hardDelete = true; - /** @var string|null */ + /** @var string */ public $setterMethod; /** * @param array $data */ - public function __construct(array $data = [], string $fieldName = 'deletedAt', bool $timeAware = false, bool $hardDelete = true, ?string $setterMethod = null) - { + public function __construct( + array $data = [], + string $fieldName = 'deletedAt', + bool $timeAware = false, + bool $hardDelete = true, + string $setterMethod = '' + ) { if ([] !== $data) { @trigger_error(sprintf( 'Passing an array as first argument to "%s()" is deprecated. Use named arguments instead.', diff --git a/src/Mapping/Annotation/Timestampable.php b/src/Mapping/Annotation/Timestampable.php index 57c19e1f99..9f8bd93a27 100644 --- a/src/Mapping/Annotation/Timestampable.php +++ b/src/Mapping/Annotation/Timestampable.php @@ -32,7 +32,7 @@ final class Timestampable implements GedmoAnnotation public $field; /** @var mixed */ public $value; - /** @var string|null */ + /** @var string */ public $setterMethod; /** @@ -45,7 +45,7 @@ public function __construct( string $on = 'update', $field = null, $value = null, - ?string $setterMethod = null + string $setterMethod = '' ) { if ([] !== $data) { @trigger_error(sprintf( diff --git a/src/Mapping/Driver/AbstractAnnotationDriver.php b/src/Mapping/Driver/AbstractAnnotationDriver.php index f6dacded60..6d88540d5b 100644 --- a/src/Mapping/Driver/AbstractAnnotationDriver.php +++ b/src/Mapping/Driver/AbstractAnnotationDriver.php @@ -137,9 +137,9 @@ protected function getRelatedClassName($metadata, $name) /** * Set the setter method for the given field. */ - protected function setSetterMethod(string $field, ?string $method, array &$config): void + protected function setSetterMethod(string $field, string $method, array &$config): void { - if (empty($method)) { + if ('' === $method) { return; }