Repository navigation
Conversation
Since v3.19.2 every string callback went through parseStringClassAndMethod(), so routes and events mapped to a global function name threw InvalidArgumentException. Call existing functions directly and keep the Class->method / Class::method parsing as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since v3.19.2 (cbc1cb3, part of #721),
Dispatcher::execute()passes every string callback toparseStringClassAndMethod(), so a route or event mapped to a plain global function name no longer works:verifyValidFunction()still lists'existingFunction'as a valid callable, and up to v3.19.1execute()only parsed strings containing->or::, so this looks like an unintended regression. We hit it on upgrade: our whole API registers routes by function name.The fix calls an existing function name directly and leaves
Class->method/Class::methodstrings on the existing parse path, soClass::nonStaticMethodis still instantiated as before, including on PHP 7.4 whereis_callable()would accept it as a static call.Added
DispatcherTest::testExecuteGlobalFunctionString; it fails on v3.19.4 with the exception above.Checked locally: phpunit on PHP 7.4.33 and 8.5.10 (501 tests), phpcs clean on the changed files, phpstan reports the same errors as on v3.19.4 (nothing new). I did not run
composer test-server.🤖 Generated with Claude Code