Skip to content

Commit 255b227

Browse files
chore(deps): update dependency rector/rector to ^2.5.1 (#490)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [rector/rector](https://getrector.com/) ([source](https://redirect.github.com/rectorphp/rector)) | `^2.4.6` → `^2.5.1` | ![age](https://developer.mend.io/api/mc/badges/age/packagist/rector%2frector/2.5.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/rector%2frector/2.4.6/2.5.1?slim=true) | --- ### Release Notes <details> <summary>rectorphp/rector (rector/rector)</summary> ### [`v2.5.1`](https://redirect.github.com/rectorphp/rector/releases/tag/2.5.1): Released Rector 2.5.1 [Compare Source](https://redirect.github.com/rectorphp/rector/compare/2.5.0...2.5.1) #### Bugfixes 🐛 - **Skip unused-skip reporting on narrowed runs** - no more false "unused skip" noise when running Rector on a subset of paths ([#&#8203;8069](https://redirect.github.com/rectorphp/rector-src/pull/8069)) - **Display skips only on uncached run** - skip report shows on real runs, not when results come from cache ([#&#8203;8071](https://redirect.github.com/rectorphp/rector-src/pull/8071)) - **`RemoveAlwaysTrueIfConditionRector`** — avoid scanning whole new statements on dynamic variable checks; moved logic to `ExprAnalyzer` and bail early on defined variables ([#&#8203;8057](https://redirect.github.com/rectorphp/rector-src/pull/8057)) ### [`v2.5.0`](https://redirect.github.com/rectorphp/rector/releases/tag/2.5.0): Released Rector 2.5 [Compare Source](https://redirect.github.com/rectorphp/rector/compare/2.4.6...2.5.0) #### New Features :partying\_face: 🎉 🎉 🎉 This release has 3 interesting new features. Let's look at them: ##### \[dx] Report skips that never matched ([#&#8203;8058](https://redirect.github.com/rectorphp/rector-src/pull/8058)) - **What?** - like PHPStan's `reportUnusedIgnores`, but for Rector `->withSkip()`. Flags skip entries that never matched anything during the run, so you can delete stale skips. - **Why?** - skips rot. You skip a path/rule to dodge a problem, later the file moves or the rule stops firing there — the skip lingers forever, silently masking nothing. This surfaces dead skips so config stays honest. ```php // rector.php return RectorConfig::configure() ->withSkip([ SimplifyUselessVariableRector::class => [ '*/src/Legacy/*', // still matches — fine '*/NonexistentUnused/*', // matches nothing — stale ], ]) ->reportUnusedSkips(); ``` Run output: ```bash [OK] Rector is done! [WARNING] This skip is unused, it never matched any element. You can remove it from "->withSkip()" * Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector => */NonexistentUnused/* ``` *** ##### **\[dx] Removing unused imports by default** ([#&#8203;8047](https://redirect.github.com/rectorphp/rector-src/pull/8047)) You can update your `rector.php` config: ```diff return RectorConfig::configure() - ->withImportNames(removeUnusedImports: true); + ->withImportNames(); ``` In case it's not for you, turn it off: ```diff return RectorConfig::configure() - ->withImportNames(); + ->withImportNames(removeUnusedImports: false); ``` *** ##### **\[dx] Introducing Drupal composer-based sets** ([#&#8203;8041](https://redirect.github.com/rectorphp/rector-src/pull/8041)), Thanks [@&#8203;bbrala](https://redirect.github.com/bbrala)! If you're using Drupal Rector, you can now enable it's per-version sets via: ```diff return RectorConfig::configure() + ->withComposerBased(drupal: true); ``` To learn more about composer-based-sets, checkout [the documentation](https://getrector.com/documentation/composer-based-sets). <br> ##### New Rules 🎉 - \[php 8.4] \[type-declaration] Add `AddArrayAnyAllClosureParamTypeRector` and `NarrowArrayAnyAllNullableParamTypeRector` ([#&#8203;8049](https://redirect.github.com/rectorphp/rector-src/pull/8049)) - \[code-quality] Add `MoveInnerFunctionToTopLevelRector` ([#&#8203;8042](https://redirect.github.com/rectorphp/rector-src/pull/8042)) - \[code-quality] Add `NewArrayItemConcatAssignToAssignRector` ([#&#8203;8045](https://redirect.github.com/rectorphp/rector-src/pull/8045)) - \[code-quality] Add `FixClassCaseSensitivityVarDocblockRector` ([#&#8203;8046](https://redirect.github.com/rectorphp/rector-src/pull/8046)) - \[polyfills] add missing polyfill to PHP 8.4 array functions ([#&#8203;8052](https://redirect.github.com/rectorphp/rector-src/pull/8052)) - \[rector] Add `AddParamTypeToRefactorMethodRector` if missing ([#&#8203;8061](https://redirect.github.com/rectorphp/rector-src/pull/8061)) <br> #### Bugfixes 🐛 - \[internal] Streamline use imports management to FileNode ([#&#8203;8040](https://redirect.github.com/rectorphp/rector-src/pull/8040)) - \[PostRector] Do not keep an unused import matched only by a partial docblock name's tail ([#&#8203;8043](https://redirect.github.com/rectorphp/rector-src/pull/8043)), Thanks [@&#8203;ruudk](https://redirect.github.com/ruudk)! - \[CodeQuality] Skip native function on `MoveInnerFunctionToTopLevelRector` ([#&#8203;8044](https://redirect.github.com/rectorphp/rector-src/pull/8044)) - Fix `--only` runs caching files as unchanged, hiding pending changes from full runs ([#&#8203;8029](https://redirect.github.com/rectorphp/rector-src/pull/8029)), Thanks [@&#8203;SanderMuller](https://redirect.github.com/SanderMuller)! - \[fix] Fix `RemoveUnusedPrivateMethodRector` for NeverType ([#&#8203;8050](https://redirect.github.com/rectorphp/rector-src/pull/8050)) - \[dead-code] Fix RemoveUnusedVariableAssignRector, allow for SplFileInfo as cleanup on purpose for gc ([#&#8203;8054](https://redirect.github.com/rectorphp/rector-src/pull/8054)) - \[fixes] Couple ClassPropertyAssignToConstructorPromotionRector, RemoveAlwaysTrueIfConditionRector and RemoveUnusedVariableAssignRector fixes ([#&#8203;8055](https://redirect.github.com/rectorphp/rector-src/pull/8055)) - \[TypeDeclaration]\[DeadCode] Skip class with Doctrine static function mapping (loadMetadata) in TypedPropertyFromAssignsRector and RemoveUnusedPrivatePropertyRector ([#&#8203;8059](https://redirect.github.com/rectorphp/rector-src/pull/8059)) - \[TypeDeclaration] Skip class with Doctrine static function mapping (loadMetadata) in TypedPropertyFromStrictConstructorRector ([#&#8203;8060](https://redirect.github.com/rectorphp/rector-src/pull/8060)) <br> #### rectorphp/rector-doctrine 🟠 - \[NodeAnalyzer] Detect Doctrine static function mapping (loadMetadata) entity in DoctrineEntityDetector ([736bf61](https://redirect.github.com/rectorphp/rector-doctrine/commit/736bf61)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/Lendable/composer-license-checker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 6defff0 commit 255b227

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"phpstan/phpstan-phpunit": "^2.0.16",
2525
"phpstan/phpstan-strict-rules": "^2.0.11",
2626
"phpunit/phpunit": "^13.2.1",
27-
"rector/rector": "^2.4.6",
27+
"rector/rector": "^2.5.1",
2828
"symfony/filesystem": "^6.2"
2929
},
3030
"autoload": {

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)