Skip to content

Commit 45d7496

Browse files
Replace implicitly nullable parameters for PHP 8.4
1 parent 788e72e commit 45d7496

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Console/ModelsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ protected function getCommentFromDocBlock(\ReflectionMethod $reflection)
13041304
*
13051305
* @return null|string
13061306
*/
1307-
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection, \Reflector $reflectorForContext = null)
1307+
protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflection, ?\Reflector $reflectorForContext = null)
13081308
{
13091309
$phpDocContext = (new ContextFactory())->createFromReflector($reflectorForContext ?? $reflection);
13101310
$context = new Context(

src/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(
5050
$config,
5151
/* Illuminate\View\Factory */
5252
$view,
53-
OutputInterface $output = null,
53+
?OutputInterface $output = null,
5454
$helpers = ''
5555
) {
5656
$this->config = $config;

tests/MacroTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testInitPhpDocClosureWithoutDocBlock(): void
5555
{
5656
$phpdoc = (new MacroMock())->getPhpDoc(
5757
new ReflectionFunction(
58-
function (int $a = null): int {
58+
function (?int $a = null): int {
5959
return 0;
6060
}
6161
)
@@ -79,7 +79,7 @@ public function testInitPhpDocClosureWithArgsAndReturnType(): void
7979
/**
8080
* Test docblock.
8181
*/
82-
function (int $a = null): int {
82+
function (?int $a = null): int {
8383
return 0;
8484
}
8585
)
@@ -103,7 +103,7 @@ public function testInitPhpDocClosureWithArgs(): void
103103
/**
104104
* Test docblock.
105105
*/
106-
function (int $a = null) {
106+
function (?int $a = null) {
107107
return 0;
108108
}
109109
)
@@ -274,7 +274,7 @@ public function __construct()
274274
// no need to call parent
275275
}
276276

277-
public function getPhpDoc(ReflectionFunctionAbstract $method, ReflectionClass $class = null): DocBlock
277+
public function getPhpDoc(ReflectionFunctionAbstract $method, ?ReflectionClass $class = null): DocBlock
278278
{
279279
return (new Macro($method, '', $class ?? $method->getClosureScopeClass()))->phpdoc;
280280
}

0 commit comments

Comments
 (0)