Repository navigation
[CodingStyle] Deprecate NewlineAfterStatementRector, as better fits coding standard - #8975
Merged
Merged
Conversation
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.
Newlines between statements are a coding standard concern, not a refactoring one. The rule definition is also vague - "add empty new line after different-type statements" - so it kept clashing with coding standard tools, other Rector rules, and user preferences. Use ECS or PHP CS Fixer instead.
Changes:
NewlineAfterStatementRectormarked@deprecated+DeprecatedInterface, body gutted to throwCodingStyleLevel(so fromwithCodingStyleLevel()and the coding style set)tests/Issues/Issue6840, rule dropped fromIndentationCrashtest configNodeGroup::STMTS_TO_HAVE_NEXT_NEWLINERelated issues - rectorphp/rector
Rule-specific:
Also mentioning the rule:
System error: "PhpParser\Internal\TokenStream::getIndentationBefore(): Return value must be of type int, null returnedrector#7652, out of memory error rector#7816, Undefined methodRector\Config\RectorConfig::tag()when upgrading from2.6.3to2.6.4rector#9880, Incorrect behavior of FinalizeClassesWithoutChildrenRector rector#8283, RemoveAlwaysElseRector is not fully refactoring code rector#9504, AnnotationToAttributeRector breaks code formatting rector#7062, Errors only partially fixed rector#7436, Errors are only fixed partially rector#7429, Error on rector process (PHPStan\Rules\DisallowedConstructs\DisallowedLooseComparisonRule) rector#7526, Could not process "/var/vhost/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ParallelProcess.php" file rector#7322, Rector just hanged with error. rector#7410, AnnotationToAttributeRector removes empty lines rector#5447, Is there any valid reason Rector should run more than once for one file? rector#7084, PHPStan\Type\IntegerRangeType::fromInterval(): Argument #1 ($min) must be of type ?int rector#7010, Issues when converting annotations to php attributes rector#6848, In TokenIterator.php line 141: Unexpected token ":", expected ')' at offset 1182 rector#6863, Customize DOCTRINE_ORM_29 to prevent deleted blank lines ? rector#6589Related PRs - rectorphp/rector-src
Rule-specific fixes and tweaks:
Also mentioning the rule: