Skip to content

Commit

Permalink
feat: fix PHP 8.4 deprecations (#208)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher Georg <[email protected]>
  • Loading branch information
Chris53897 and Chris8934 authored Dec 2, 2024
1 parent 7fc2831 commit 6ed19f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit 6ed19f5

Please sign in to comment.