Repository navigation
Fix three autofixes that produced broken or wrong output - #84
Merged
dereuromark merged 1 commit intoOct 11, 2026
Merged
Conversation
PreferCastOverFunction rewrote the first-class callable `strval(...)` to `(string)(...)`, which is a parse error. The callable form is now skipped. DocBlockParamAllowDefaultValue did not treat `non-empty-array`, `non-empty-list` and a bare `list` as covering an `array` typehint and appended `|array` to the param type. DocBlockThrows wrote a class from the current namespace as if it were global, so `throw new LocalException()` in namespace `App` produced `\LocalException`. Unimported names are now resolved against the namespace the method sits in, and a qualified relative name such as `Sub\NestedException`, which was skipped before, is resolved as well.
dereuromark
deleted the
fix/autofix-callable-nonempty-throws-namespace
branch
October 11, 2026 15:07
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.
Three autofixes changed valid code into something broken or wrong. All three showed up while running
phpcbfon a new package.PreferCastOverFunction
First-class callable syntax was rewritten into a parse error:
The callable form is now left alone.
DocBlockParamAllowDefaultValue
non-empty-array<...>,non-empty-list<...>and a barelistwere not recognized as covering anarraytypehint, so the fixer appended|arrayto the param type.DocBlockThrows
A class from the current namespace was annotated as a global one. In namespace
App,throw new LocalException()produced a throws tag for\LocalExceptioninstead of\App\LocalException. Names without an import are now resolved against the namespace the method sits in, which also covers files with several namespace blocks.Behavior change: a qualified relative name such as
throw new Sub\NestedException()was skipped entirely before. It is now detected and reported like any other missing throws tag.