[FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor#4058
Merged
TomasVotruba merged 5 commits intomainfrom Jun 4, 2023
Merged
[FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor#4058TomasVotruba merged 5 commits intomainfrom
TomasVotruba merged 5 commits intomainfrom
Conversation
Member
Author
|
I removed with inline html fixture as |
Member
Author
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
samsonasik
referenced
this pull request
in rectorphp/rector
Jun 3, 2023
rectorphp/rector-src@203be2b skip tracy from downgrade one
Member
Author
|
@TomasVotruba here the output with warning instead of skip which fine on indirect change near InlineHTML: ➜ rector-src git:(add-warning) ✗ bin/rector process vendor/tracy/tracy/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml --config build/config/config-downgrade.php --dry-run
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%
[WARNING] File vendor/tracy/tracy/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml has InlineHTML node, this
may cause unexpected output, you may need to manually verify the changed file
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================
1) vendor/tracy/tracy/src/Tracy/BlueScreen/assets/section-stack-callStack.phtml:71
---------- begin diff ----------
@@ @@
try {
$r = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
$params = $r->getParameters();
- } catch (\Exception) {
+ } catch (\Exception $exception) {
$params = [];
}
foreach ($row['args'] as $k => $v) {
----------- end diff -----------
Applied rules:
* DowngradeNonCapturingCatchesRector (https://wiki.php.net/rfc/non-capturing_catches)so this should good to have it processed 👍 |
Ocramius
approved these changes
Jun 4, 2023
Ocramius
left a comment
There was a problem hiding this comment.
Good idea to leave mixed HTML+PHP alone, but some more verification (test) would be a good idea 😁
Contributor
|
It seems better to support mixed HTML+PHP even if there are limitations. |
Member
Author
|
@Ocramius the tests were on MixedPhpHtmlDecorator, since that decorator removed at PR: so the tests not needed in here |
kenjis
approved these changes
Jun 4, 2023
This reverts commit 203be2b.
Member
Author
Member
|
Looks good, lets give it a try 👍 If the feedback is rather breaking code again, we'll disable it to avoid causing errors. |
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.
Ref #4055 (review)
Instead of skip, better to show warning so user can just use it but need to verify manually the rectored file.