From edb56754d1af235f19de173c115540ce6f15d062 Mon Sep 17 00:00:00 2001 From: Jeppe Knockaert Date: Sat, 14 Dec 2024 11:06:34 +0100 Subject: [PATCH] Fix PHP 8.4 deprecations (#1618) * Replace implicitly nullable parameters for PHP 8.4 * composer fix-style --------- Co-authored-by: laravel-ide-helper --- tests/MacroTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/MacroTest.php b/tests/MacroTest.php index cf1f79fa4..f1cce9a32 100644 --- a/tests/MacroTest.php +++ b/tests/MacroTest.php @@ -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; } ) @@ -79,7 +79,7 @@ public function testInitPhpDocClosureWithArgsAndReturnType(): void /** * Test docblock. */ - function (int $a = null): int { + function (?int $a = null): int { return 0; } ) @@ -103,7 +103,7 @@ public function testInitPhpDocClosureWithArgs(): void /** * Test docblock. */ - function (int $a = null) { + function (?int $a = null) { return 0; } ) @@ -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; }