Skip to content

Commit

Permalink
Handles PHP8.4 nullable type deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Mar 22, 2024
1 parent a6ca4c1 commit bef7d42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'no_superfluous_phpdoc_tags' => true,
'no_trailing_comma_in_singleline' => true,
'no_unused_imports' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
'phpdoc_align' => ['align' => 'left'],
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.51.0",
"phpstan/phpstan": "^1.10.60",
"friendsofphp/php-cs-fixer": "^3.52.1",
"phpstan/phpstan": "^1.10.64",
"phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-strict-rules": "^1.5.2",
"phpunit/phpunit": "^10.5.12",
"phpunit/phpunit": "^10.5.15",
"symfony/var-dumper": "^6.4.4"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/DatePoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function fromDate(DateTimeInterface $date): self
/**
* @throws Exception
*/
public static function fromDateString(string $dateString, DateTimeZone|string $timezone = null): self
public static function fromDateString(string $dateString, DateTimeZone|string|null $timezone = null): self
{
return new self(new DateTimeImmutable($dateString, match (true) {
$timezone instanceof DateTimeZone => $timezone,
Expand Down

0 comments on commit bef7d42

Please sign in to comment.