rectorphp/rector (rector/rector)
### [`v0.18.6`](https://togithub.com/rectorphp/rector/releases/tag/0.18.6): Released Rector 0.18.6
[Compare Source](https://togithub.com/rectorphp/rector/compare/0.18.5...0.18.6)
#### New Features and Changes :partying_face:
- \[CodeQuality] Add CompleteMissingIfElseBracketRector ([#5121](https://togithub.com/rectorphp/rector-src/pull/5121))
- \[CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector ([#5124](https://togithub.com/rectorphp/rector-src/pull/5124))
- \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector ([#5156](https://togithub.com/rectorphp/rector-src/pull/5156))
- \[DeadCode] Add RemoveUselessReturnExprInConstructRector ([#5158](https://togithub.com/rectorphp/rector-src/pull/5158))
- Improve UnaryPlus and UnaryMinus support in isDynamicExpr ([#5177](https://togithub.com/rectorphp/rector-src/pull/5177)), Thanks [@JulianCBC](https://togithub.com/JulianCBC)!
#### Bugfixes :bug:
- \[CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector ([#5122](https://togithub.com/rectorphp/rector-src/pull/5122))
- \[CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector ([#5125](https://togithub.com/rectorphp/rector-src/pull/5125))
- \[CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector ([#5126](https://togithub.com/rectorphp/rector-src/pull/5126))
- \[CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector ([#5127](https://togithub.com/rectorphp/rector-src/pull/5127))
- \[CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector ([#5129](https://togithub.com/rectorphp/rector-src/pull/5129))
- \[CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector ([#5132](https://togithub.com/rectorphp/rector-src/pull/5132))
- Skip `__construct()` in BoolReturnTypeFromStrictScalarReturnsRector ([#5133](https://togithub.com/rectorphp/rector-src/pull/5133)), Thanks [@staabm](https://togithub.com/staabm)!
- \[CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector ([#5134](https://togithub.com/rectorphp/rector-src/pull/5134))
- \[CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector ([#5135](https://togithub.com/rectorphp/rector-src/pull/5135))
- \[CodeQuality] Use its start token pos on Else\_ on CompleteMissingIfElseBracketRector as no cond ([#5136](https://togithub.com/rectorphp/rector-src/pull/5136))
- \[PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() ([#5138](https://togithub.com/rectorphp/rector-src/pull/5138))
- \[TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector ([#5144](https://togithub.com/rectorphp/rector-src/pull/5144))
- \[TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector ([#5149](https://togithub.com/rectorphp/rector-src/pull/5149))
- \[CodeQuality] Fix missing parentheses on CombineIfRector ([#5151](https://togithub.com/rectorphp/rector-src/pull/5151))
- \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector ([#5155](https://togithub.com/rectorphp/rector-src/pull/5155))
- \[CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector ([#5159](https://togithub.com/rectorphp/rector-src/pull/5159))
- \[CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector ([#5161](https://togithub.com/rectorphp/rector-src/pull/5161))
- \[CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector ([#5163](https://togithub.com/rectorphp/rector-src/pull/5163))
- \[PostRector] Reduce loop on ClassRenamingPostRector ([#5174](https://togithub.com/rectorphp/rector-src/pull/5174))
- \[PostRector] Fix ClassRenamingPostRector return when no auto import replacement ([#5175](https://togithub.com/rectorphp/rector-src/pull/5175))
- \[Renaming] Skip nullable object object|null on RenameMethodRector ([#5181](https://togithub.com/rectorphp/rector-src/pull/5181))
- \[Downgradephp81]\[DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector ([#5183](https://togithub.com/rectorphp/rector-src/pull/5183))
- \[Naming] Skip DateTime from renaming, to keep convention of named dates ([#5184](https://togithub.com/rectorphp/rector-src/pull/5184))
- Skip new self in RenameVariableToMatchNewTypeRector ([#5185](https://togithub.com/rectorphp/rector-src/pull/5185))
- Skip DateTime in ExpectedNameResolver ([#5186](https://togithub.com/rectorphp/rector-src/pull/5186))
- \[Naming] Skip all kinds of generators ([#5187](https://togithub.com/rectorphp/rector-src/pull/5187))
- \[Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector ([#5188](https://togithub.com/rectorphp/rector-src/pull/5188))
- \[Php70] Fix Php4 contructor not replaced with \__construct() on php 7.4 environment ([#5189](https://togithub.com/rectorphp/rector-src/pull/5189))
- \[Php74]\[Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled ([#5190](https://togithub.com/rectorphp/rector-src/pull/5190))
- \[TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() ([#5191](https://togithub.com/rectorphp/rector-src/pull/5191))
- Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() ([#5193](https://togithub.com/rectorphp/rector-src/pull/5193))
- \[PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper ([#5141](https://togithub.com/rectorphp/rector-src/pull/5141))
- \[DeadCode] Remove UnionType check on RecastingRemovalRector ([#5142](https://togithub.com/rectorphp/rector-src/pull/5142))
- Remove src/constants.php for T_ENUM and T_NAME_RELATIVE ([#5143](https://togithub.com/rectorphp/rector-src/pull/5143))
- \[PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper ([#5145](https://togithub.com/rectorphp/rector-src/pull/5145))
- \[PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper ([#5146](https://togithub.com/rectorphp/rector-src/pull/5146))
- \[DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector ([#5152](https://togithub.com/rectorphp/rector-src/pull/5152))
- \[DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector ([#5153](https://togithub.com/rectorphp/rector-src/pull/5153))
- \[DeadCode] Skip used in next For\_/Foreach\_ on RemoveDeadIfForeachForRector ([#5154](https://togithub.com/rectorphp/rector-src/pull/5154))
- \[DeadCode] Handle file_get_contents() only remove variable on RemoveUnusedVariableAssignRector ([#5162](https://togithub.com/rectorphp/rector-src/pull/5162))
- \[DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#5160](https://togithub.com/rectorphp/rector-src/pull/5160))
- RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types ([#5169](https://togithub.com/rectorphp/rector-src/pull/5169)), Thanks [@staabm](https://togithub.com/staabm)!
- RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch ([#5166](https://togithub.com/rectorphp/rector-src/pull/5166)), Thanks [@staabm](https://togithub.com/staabm)!
- \[DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector ([#5172](https://togithub.com/rectorphp/rector-src/pull/5172))
- \[AutoImport] \[Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import ([#5168](https://togithub.com/rectorphp/rector-src/pull/5168))
- \[DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector ([#5195](https://togithub.com/rectorphp/rector-src/pull/5195))
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
â™» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
0.18.5
->0.18.6
Release Notes
rectorphp/rector (rector/rector)
### [`v0.18.6`](https://togithub.com/rectorphp/rector/releases/tag/0.18.6): Released Rector 0.18.6 [Compare Source](https://togithub.com/rectorphp/rector/compare/0.18.5...0.18.6) #### New Features and Changes :partying_face: - \[CodeQuality] Add CompleteMissingIfElseBracketRector ([#5121](https://togithub.com/rectorphp/rector-src/pull/5121)) - \[CodeQuality] Add Else and ElseIf on CompleteMissingIfElseBracketRector ([#5124](https://togithub.com/rectorphp/rector-src/pull/5124)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on AddReturnTypeDeclarationFromYieldsRector ([#5156](https://togithub.com/rectorphp/rector-src/pull/5156)) - \[DeadCode] Add RemoveUselessReturnExprInConstructRector ([#5158](https://togithub.com/rectorphp/rector-src/pull/5158)) - Improve UnaryPlus and UnaryMinus support in isDynamicExpr ([#5177](https://togithub.com/rectorphp/rector-src/pull/5177)), Thanks [@JulianCBC](https://togithub.com/JulianCBC)!#### Bugfixes :bug: - \[CodeQuality] Skip VB style if endif on CompleteMissingIfElseBracketRector ([#5122](https://togithub.com/rectorphp/rector-src/pull/5122)) - \[CodeQuality] Skip direct InlineHTML on CompleteMissingIfElseBracketRector ([#5125](https://togithub.com/rectorphp/rector-src/pull/5125)) - \[CodeQuality] Skip spaced elseif cond on CompleteMissingIfElseBracketRector ([#5126](https://togithub.com/rectorphp/rector-src/pull/5126)) - \[CodeQuality] Only check start from current Stmt token pos up until open parentheses on CompleteMissingIfElseBracketRector ([#5127](https://togithub.com/rectorphp/rector-src/pull/5127)) - \[CodeQuality] Handle all if,elseif,else no bracket on CompleteMissingIfElseBracketRector ([#5129](https://togithub.com/rectorphp/rector-src/pull/5129)) - \[CodeQuality] Skip VB style in complex HTML on CompleteMissingIfElseBracketRector ([#5132](https://togithub.com/rectorphp/rector-src/pull/5132)) - Skip `__construct()` in BoolReturnTypeFromStrictScalarReturnsRector ([#5133](https://togithub.com/rectorphp/rector-src/pull/5133)), Thanks [@staabm](https://togithub.com/staabm)! - \[CodeQuality] Handle missing bracket on If only on CompleteMissingIfElseBracketRector ([#5134](https://togithub.com/rectorphp/rector-src/pull/5134)) - \[CodeQuality] Handle on closure, anonymous function, method call on CompleteMissingIfElseBracketRector ([#5135](https://togithub.com/rectorphp/rector-src/pull/5135)) - \[CodeQuality] Use its start token pos on Else\_ on CompleteMissingIfElseBracketRector as no cond ([#5136](https://togithub.com/rectorphp/rector-src/pull/5136)) - \[PhpParser] Reduce AstResolver complexity by move check fileName is null to parseFileNameToDecoratedNodes() ([#5138](https://togithub.com/rectorphp/rector-src/pull/5138)) - \[TypeDeclaration] Handle Union with array type on ReturnUnionTypeRector ([#5144](https://togithub.com/rectorphp/rector-src/pull/5144)) - \[TypeDeclaration] Handle union A extends B on ReturnUnionTypeRector ([#5149](https://togithub.com/rectorphp/rector-src/pull/5149)) - \[CodeQuality] Fix missing parentheses on CombineIfRector ([#5151](https://togithub.com/rectorphp/rector-src/pull/5151)) - \[TypeDeclaration] Utilize ClassMethodReturnTypeOverrideGuard on NumericReturnTypeFromStrictScalarReturnsRector ([#5155](https://togithub.com/rectorphp/rector-src/pull/5155)) - \[CodeQuality] Handle negative and positive int/float on InlineConstructorDefaultToPropertyRector ([#5159](https://togithub.com/rectorphp/rector-src/pull/5159)) - \[CodeQuality] Skip docblock usage on SimplifyBoolIdenticalTrueRector ([#5161](https://togithub.com/rectorphp/rector-src/pull/5161)) - \[CodeQuality] Skip magic property fetch on IssetOnPropertyObjectToPropertyExistsRector ([#5163](https://togithub.com/rectorphp/rector-src/pull/5163)) - \[PostRector] Reduce loop on ClassRenamingPostRector ([#5174](https://togithub.com/rectorphp/rector-src/pull/5174)) - \[PostRector] Fix ClassRenamingPostRector return when no auto import replacement ([#5175](https://togithub.com/rectorphp/rector-src/pull/5175)) - \[Renaming] Skip nullable object object|null on RenameMethodRector ([#5181](https://togithub.com/rectorphp/rector-src/pull/5181)) - \[Downgradephp81]\[DowngradePhp80] Handle No scope crash on DowngradeSetAccessibleReflectionPropertyRector + DowngradeMatchToSwitchRector ([#5183](https://togithub.com/rectorphp/rector-src/pull/5183)) - \[Naming] Skip DateTime from renaming, to keep convention of named dates ([#5184](https://togithub.com/rectorphp/rector-src/pull/5184)) - Skip new self in RenameVariableToMatchNewTypeRector ([#5185](https://togithub.com/rectorphp/rector-src/pull/5185)) - Skip DateTime in ExpectedNameResolver ([#5186](https://togithub.com/rectorphp/rector-src/pull/5186)) - \[Naming] Skip all kinds of generators ([#5187](https://togithub.com/rectorphp/rector-src/pull/5187)) - \[Renaming] Skip pointless names in RenameForeachValueVariableToMatchMethodCallReturnTypeRector ([#5188](https://togithub.com/rectorphp/rector-src/pull/5188)) - \[Php70] Fix Php4 contructor not replaced with \__construct() on php 7.4 environment ([#5189](https://togithub.com/rectorphp/rector-src/pull/5189)) - \[Php74]\[Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled ([#5190](https://togithub.com/rectorphp/rector-src/pull/5190)) - \[TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() ([#5191](https://togithub.com/rectorphp/rector-src/pull/5191)) - Fix phpstan notice $phpVersion on Rector\Config\RectorConfig::phpVersion() ([#5193](https://togithub.com/rectorphp/rector-src/pull/5193)) - \[PHPStanStaticTypeMapper] Remove BoolUnionTypeAnalyzer on UnionTypeMapper ([#5141](https://togithub.com/rectorphp/rector-src/pull/5141)) - \[DeadCode] Remove UnionType check on RecastingRemovalRector ([#5142](https://togithub.com/rectorphp/rector-src/pull/5142)) - Remove src/constants.php for T_ENUM and T_NAME_RELATIVE ([#5143](https://togithub.com/rectorphp/rector-src/pull/5143)) - \[PHPStanStaticTypeMapper] Remove narrow string and int on UnionTypeMapper ([#5145](https://togithub.com/rectorphp/rector-src/pull/5145)) - \[PHPStanStaticTypeMapper] Remove matchArrayTypes() on UnionTypeMapper ([#5146](https://togithub.com/rectorphp/rector-src/pull/5146)) - \[DeadCode] Skip indirect variable definition on RemoveNonExistingVarAnnotationRector ([#5152](https://togithub.com/rectorphp/rector-src/pull/5152)) - \[DeadCode] Skip key used in next stmt on RemoveUnusedForeachKeyRector ([#5153](https://togithub.com/rectorphp/rector-src/pull/5153)) - \[DeadCode] Skip used in next For\_/Foreach\_ on RemoveDeadIfForeachForRector ([#5154](https://togithub.com/rectorphp/rector-src/pull/5154)) - \[DeadCode] Handle file_get_contents() only remove variable on RemoveUnusedVariableAssignRector ([#5162](https://togithub.com/rectorphp/rector-src/pull/5162)) - \[DeadCode] Skip count() on mixed on RemoveUnusedNonEmptyArrayBeforeForeachRector ([#5160](https://togithub.com/rectorphp/rector-src/pull/5160)) - RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types ([#5169](https://togithub.com/rectorphp/rector-src/pull/5169)), Thanks [@staabm](https://togithub.com/staabm)! - RemoveUnusedNonEmptyArrayBeforeForeachRector: skip array dim fetch ([#5166](https://togithub.com/rectorphp/rector-src/pull/5166)), Thanks [@staabm](https://togithub.com/staabm)! - \[DeadCode] Skip return false pseudo type in union on RemoveUselessReturnTagRector ([#5172](https://togithub.com/rectorphp/rector-src/pull/5172)) - \[AutoImport] \[Renaming] Skip remove used use statement on annotation during rename + auto import when no replacement on auto import ([#5168](https://togithub.com/rectorphp/rector-src/pull/5168)) - \[DeadCode] Mirror comment on assign method call on RemoveUnusedVariableAssignRector ([#5195](https://togithub.com/rectorphp/rector-src/pull/5195))
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
â™» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
Read more information about the use of Renovate Bot within Laminas.