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 92bb4d1 commit 4ab2451
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 @@ -27,12 +27,12 @@
"php": "^8.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.51.0",
"phpstan/phpstan": "^1.10.59",
"friendsofphp/php-cs-fixer": "^3.52.1",
"phpstan/phpstan": "^1.10.64",
"phpstan/phpstan-strict-rules": "^1.5.2",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpunit/phpunit": "^10.5.11",
"phpunit/phpunit": "^10.5.15",
"symfony/var-dumper": "^6.4.4"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Enum/JavaScriptConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function new(): self
);
}

public function propertyNameCase(Closure $casing = null): self
public function propertyNameCase(?Closure $casing = null): self
{
return new self(
$this->useSymbol,
Expand Down
2 changes: 1 addition & 1 deletion src/Error/Cloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function __invoke(mixed ...$arguments): mixed
/**
* @throws ErrorException
*/
protected function errorHandler(int $errno, string $errstr, string $errfile = null, int $errline = null): bool
protected function errorHandler(int $errno, string $errstr, ?string $errfile = null, ?int $errline = null): bool
{
if (ReportingLevel::fromEnv()->doesNotContain($errno)) {
return false;
Expand Down

0 comments on commit 4ab2451

Please sign in to comment.