Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix PHP 8.4 deprecations #208

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Anonymization/Anonymizer/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(), '/');
Expand Down
4 changes: 2 additions & 2 deletions tests/Mock/TestingExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {}
Expand Down