diff --git a/src/Anonymization/Anonymizer/Options.php b/src/Anonymization/Anonymizer/Options.php index 3d490fce..cb131f17 100644 --- a/src/Anonymization/Anonymizer/Options.php +++ b/src/Anonymization/Anonymizer/Options.php @@ -56,7 +56,7 @@ public function toDisplayString(): string )); } - public function getString(string $name, string $default = null, bool $required = false): ?string + public function getString(string $name, ?string $default = null, bool $required = false): ?string { $value = $this->get($name, $default, $required); @@ -71,7 +71,7 @@ public function getString(string $name, string $default = null, bool $required = throw new \InvalidArgumentException(\sprintf("Option '%s' must be a string", $name)); } - public function getBool(string $name, bool $default = null, bool $required = false): ?bool + public function getBool(string $name, ?bool $default = null, bool $required = false): ?bool { $value = $this->get($name, $default, $required); @@ -93,7 +93,7 @@ public function getBool(string $name, bool $default = null, bool $required = fal return (bool) $value; } - public function getInt(string $name, int $default = null, bool $required = false): ?int + public function getInt(string $name, ?int $default = null, bool $required = false): ?int { $value = $this->get($name, $default, $required); @@ -108,7 +108,7 @@ public function getInt(string $name, int $default = null, bool $required = false throw new \InvalidArgumentException(\sprintf("Option '%s' must be an int", $name)); } - public function getFloat(string $name, float $default = null, bool $required = false): ?float + public function getFloat(string $name, ?float $default = null, bool $required = false): ?float { $value = $this->get($name, $default, $required); @@ -124,7 +124,7 @@ public function getFloat(string $name, float $default = null, bool $required = f } - public function getDate(string $name, \DateTimeImmutable $default = null, bool $required = false): ?\DateTimeImmutable + public function getDate(string $name, ?\DateTimeImmutable $default = null, bool $required = false): ?\DateTimeImmutable { $value = $this->get($name, $default, $required); @@ -143,7 +143,7 @@ public function getDate(string $name, \DateTimeImmutable $default = null, bool $ } } - public function getInterval(string $name, \DateInterval $default = null, bool $required = false): ?\DateInterval + public function getInterval(string $name, ?\DateInterval $default = null, bool $required = false): ?\DateInterval { $value = $this->get($name, $default, $required); diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index 9d693d5a..206a0745 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -23,7 +23,7 @@ public function listBackups( string $connectionName = 'default', string $extension = 'sql', bool $onlyExpired = false, - string $preserveFile = null + ?string $preserveFile = null ): array { $config = $this->configReg->getConnectionConfig($connectionName); $storagePath = \rtrim($config->getStorageDirectory(), '/'); diff --git a/tests/Mock/TestingExecutionContext.php b/tests/Mock/TestingExecutionContext.php index 7811536e..87c43adf 100644 --- a/tests/Mock/TestingExecutionContext.php +++ b/tests/Mock/TestingExecutionContext.php @@ -43,7 +43,7 @@ public function buildViolation(string $message, array $parameters = []): Constra null, new class () implements TranslatorInterface { #[\Override] - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { return $id; } @@ -71,7 +71,7 @@ public function getObject(): ?object } #[\Override] - public function setNode(mixed $value, ?object $object, MetadataInterface $metadata = null, string $propertyPath): void {} + public function setNode(mixed $value, ?object $object, ?MetadataInterface $metadata, string $propertyPath): void {} #[\Override] public function setGroup(?string $group): void {}