Repository navigation
PHP: Fix the indent of a method chain after throw or return - #9849
Open
matthiasblaesing wants to merge 2 commits into
Open
matthiasblaesing wants to merge 2 commits into
matthiasblaesing wants to merge 2 commits into
Conversation
- apache#9841 - A throw statement is an ExpressionStatement with a ThrowExpression since PHP 8.0 support (NETBEANS-4443). visit(ExpressionStatement) added the indent of a statement to it, and visit(MethodInvocation) added the indent of the chain, so the lines of a chain after throw got the continuation indent twice - Look through the ThrowExpression when deciding whether the statement adds an indent, as is done for a method call statement - Add unit tests The change and the tests were written with the help of an AI model and were not run: the formatter tests were not built or executed, only the changed class was compiled against the jars of NetBeans 31. The expected files are written by hand. The author is not a Java developer. Assisted-by: Claude Sonnet 5.5
… and return statements
|
Hi Matthias, thank you very much for taking this over and for the extra work: fixing the authorship, finding the same problem with I confirmed the I am happy with the change, please go ahead and ping the PHP reviewers. Thanks again! |
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.
Method chains after throw and return gained (at least) one indention level to much.
After this change the indention looks like this (the chains are at indention level 2, 8 spaces indented):
Co-authored-by: Pavel Železný zeleznypa@users.noreply.github.com
Assisted-by: Claude Sonnet 5.5
Closes: #9842
Closes: #9841