Fixed typing of TextConstraint

This commit is contained in:
Jan Böhmer 2024-06-22 19:06:07 +02:00
parent c780c0bd92
commit eb02404d49
2 changed files with 9 additions and 16 deletions

View file

@ -30,15 +30,8 @@ class TagsConstraint extends AbstractConstraint
{ {
final public const ALLOWED_OPERATOR_VALUES = ['ANY', 'ALL', 'NONE']; final public const ALLOWED_OPERATOR_VALUES = ['ANY', 'ALL', 'NONE'];
/** public function __construct(string $property, string $identifier = null,
* @param string $value protected ?string $value = null,
*/
public function __construct(string $property, string $identifier = null, /**
* @var string The value to compare to
*/
protected $value = null, /**
* @var string|null The operator to use
*/
protected ?string $operator = '') protected ?string $operator = '')
{ {
parent::__construct($property, $identifier); parent::__construct($property, $identifier);
@ -61,12 +54,12 @@ class TagsConstraint extends AbstractConstraint
return $this; return $this;
} }
public function getValue(): string public function getValue(): ?string
{ {
return $this->value; return $this->value;
} }
public function setValue(string $value): self public function setValue(?string $value): self
{ {
$this->value = $value; $this->value = $value;
return $this; return $this;

View file

@ -33,9 +33,9 @@ class TextConstraint extends AbstractConstraint
* @param string $value * @param string $value
*/ */
public function __construct(string $property, string $identifier = null, /** public function __construct(string $property, string $identifier = null, /**
* @var string The value to compare to * @var string|null The value to compare to
*/ */
protected $value = null, /** protected ?string $value = null, /**
* @var string|null The operator to use * @var string|null The operator to use
*/ */
protected ?string $operator = '') protected ?string $operator = '')
@ -60,12 +60,12 @@ class TextConstraint extends AbstractConstraint
return $this; return $this;
} }
public function getValue(): string public function getValue(): ?string
{ {
return $this->value; return $this->value;
} }
public function setValue(string $value): self public function setValue(?string $value): self
{ {
$this->value = $value; $this->value = $value;
return $this; return $this;