Skip to content

Commit

Permalink
Fix PHP 8.4 deprecations nullable objects (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Dec 2, 2024
1 parent 5787e9b commit a6d12f3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
'get_class_to_class_keyword' => false,
'phpdoc_separation' => false,
'fully_qualified_strict_types' => false,
'nullable_type_declaration_for_default_null_value' => true,
'native_function_invocation' => false,
'trailing_comma_in_multiline' => false,
])
->setRiskyAllowed(true)
->setFinder(
Expand Down
2 changes: 1 addition & 1 deletion Routing/Loader/Reader/RestActionReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ private function readMethodAnnotations(\ReflectionMethod $reflectionMethod, stri
return $annotations;
}

private function addRoute(RestRouteCollection $collection, string $routeName, Route $route, bool $isCollection, bool $isInflectable, RouteAnnotation $annotation = null): void
private function addRoute(RestRouteCollection $collection, string $routeName, Route $route, bool $isCollection, bool $isInflectable, ?RouteAnnotation $annotation = null): void
{
if ($annotation && null !== $annotation->getName()) {
$options = $annotation->getOptions();
Expand Down
8 changes: 4 additions & 4 deletions Routing/Loader/RestRouteProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function importResource(
LoaderInterface $loader,
$resource,
array $parents = [],
string $routePrefix = null,
string $namePrefix = null,
string $type = null,
string $currentDir = null
?string $routePrefix = null,
?string $namePrefix = null,
?string $type = null,
?string $currentDir = null
): RouteCollection {
$loader = $loader->resolve($resource, $type);

Expand Down
2 changes: 1 addition & 1 deletion Routing/Loader/RestXmlCollectionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
RestRouteProcessor $processor,
bool $includeFormat = true,
array $formats = [],
string $defaultFormat = null
?string $defaultFormat = null
) {
parent::__construct($locator);

Expand Down
2 changes: 1 addition & 1 deletion Routing/Loader/RestYamlCollectionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
RestRouteProcessor $processor,
bool $includeFormat = true,
array $formats = [],
string $defaultFormat = null
?string $defaultFormat = null
) {
parent::__construct($locator);

Expand Down

0 comments on commit a6d12f3

Please sign in to comment.