Skip to content

Commit 5bdddc2

Browse files
bug symfony#54187 [FrameworkBundle] Fix PHP 8.4 deprecation on ReflectionMethod (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Fix PHP 8.4 deprecation on `ReflectionMethod` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Part of symfony#54180 | License | MIT This fixes: ``` 16x: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead 4x in RouterDebugCommandTest::testDumpAllRoutes from Symfony\Bundle\FrameworkBundle\Tests\Functional 4x in RouterDebugCommandTest::testSearchMultipleRoutesWithoutInteraction from Symfony\Bundle\FrameworkBundle\Tests\Functional 4x in RouterDebugCommandTest::testShowAliases from Symfony\Bundle\FrameworkBundle\Tests\Functional 2x in TextDescriptorTest::testDescribeRouteWithControllerLink from Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor 1x in RouterDebugCommandTest::testDumpOneRoute from Symfony\Bundle\FrameworkBundle\Tests\Functional ... ``` Commits ------- 8746765 [FrameworkBundle] Fix PHP 8.4 deprecation
2 parents ca6858f + 8746765 commit 5bdddc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ private function formatControllerLink($controller, string $anchorText, ?callable
559559
} elseif (!\is_string($controller)) {
560560
return $anchorText;
561561
} elseif (str_contains($controller, '::')) {
562-
$r = new \ReflectionMethod($controller);
562+
$r = new \ReflectionMethod(...explode('::', $controller, 2));
563563
} else {
564564
$r = new \ReflectionFunction($controller);
565565
}

0 commit comments

Comments
 (0)