[WIP] do not override printing files with previous stmts in MultipleClassFileToPsr4ClassesRector#1463
Closed
TomasVotruba wants to merge 3 commits intomasterfrom
Closed
[WIP] do not override printing files with previous stmts in MultipleClassFileToPsr4ClassesRector#1463TomasVotruba wants to merge 3 commits intomasterfrom
TomasVotruba wants to merge 3 commits intomasterfrom
Conversation
Member
Author
|
In the end it would take extreme time to make is at least "not-bad". Still better to stick with own/prepared coding standards that will fix it better |
Member
Author
|
Replaced by #1464 |
TomasVotruba
added a commit
that referenced
this pull request
Dec 11, 2021
rectorphp/rector-src@4bb7ad6 [CodeQuality] Handle inner function return exactly DateTime on DateTimeToDateTimeInterfaceRector (#1463)
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.
Closes #1408 The issues is a bit deeper than just printing file.
For printing new class, the style of old nodes is used. It not designed to do that though, so it brings various of conclits.
This fix prints new class in a raw native php-parser (= "ugly") format, regardless the format of the original file.
My idea is to detect somehow style from the parsed file and apply it to every new printed file, e.g.
declare(strict_types=1);is always on first line in the file, so every printedDeclare_node should be on first line. It won't be easy, but more reliable.What do you think @JanMikes ?