Skip to content

Commit

Permalink
Replace implicitly nullable parameters for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
JeppeKnockaert committed Nov 27, 2024
1 parent 788e72e commit 13763ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ protected function getCommentFromDocBlock(\ReflectionMethod $reflection)
*
* @return null|string
*/
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection, \Reflector $reflectorForContext = null)
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection, ?\Reflector $reflectorForContext = null)
{
$phpDocContext = (new ContextFactory())->createFromReflector($reflectorForContext ?? $reflection);
$context = new Context(
Expand Down
2 changes: 1 addition & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(
$config,
/* Illuminate\View\Factory */
$view,
OutputInterface $output = null,
?OutputInterface $output = null,
$helpers = ''
) {
$this->config = $config;
Expand Down
8 changes: 4 additions & 4 deletions tests/MacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testInitPhpDocClosureWithoutDocBlock(): void
{
$phpdoc = (new MacroMock())->getPhpDoc(
new ReflectionFunction(
function (int $a = null): int {
function (?int $a = null): int {
return 0;
}
)
Expand All @@ -79,7 +79,7 @@ public function testInitPhpDocClosureWithArgsAndReturnType(): void
/**
* Test docblock.
*/
function (int $a = null): int {
function (?int $a = null): int {
return 0;
}
)
Expand All @@ -103,7 +103,7 @@ public function testInitPhpDocClosureWithArgs(): void
/**
* Test docblock.
*/
function (int $a = null) {
function (?int $a = null) {
return 0;
}
)
Expand Down Expand Up @@ -274,7 +274,7 @@ public function __construct()
// no need to call parent
}

public function getPhpDoc(ReflectionFunctionAbstract $method, ReflectionClass $class = null): DocBlock
public function getPhpDoc(ReflectionFunctionAbstract $method, ?ReflectionClass $class = null): DocBlock
{
return (new Macro($method, '', $class ?? $method->getClosureScopeClass()))->phpdoc;
}
Expand Down

0 comments on commit 13763ae

Please sign in to comment.