0.18.0
Release highlights
This release of Drupal Rector introduces backwards compatible fixes for new rectors that target deprecations in Drupal 10. This is made possible by using the new DeprecationHelper
class introduced in Drupal 10.1.
We also worked on making the code more sustainable by employing ConfigurableRectorInterface
. This interface allows passing configuration to a rector to set certain variables. This means it is easier to reuse rectors that for example rewrite a function to a static call without introducing new code.
Rector has also been upgraded from 0.15 to 0.18, bringing a lot of improvement, but also making it harder to add comments to code generated by Rector. This there are instances where the previous version added comments, that the current does not.
- Support for Drupal 10 deprecations and testing by @bbrala in #252
- Support for backwards compatible rector rules and version scoping of rules by @bbrala in #250
Upgrade notes
Because rector moved to Laravel dependency injection a new version of rector.php
must be copies/configured in your project root.
New rectors
- Issue #3354343: Add TwigSetList::TWIG_240 to D9 deprecations. by @m4olivei in #223
- Add new Rector for system_sort_modules_by_info_name() by @bbrala in #253
- module_load_install() is deprecated in 9.4 and removed in 10. by @bbrala in #239
- Implement watchdog_exception rector by @bbrala in #262
- 9.3 Multiple taxonomy rectors by @bbrala in #254
What's Changed
- Remove NodesToAddCollector by @bbrala in #225
- Remove dependency on rector-src by @bbrala in #236
- Update PHPUnit configuration by @agentrickard in #237
- Phase 1 - Refactor to support Rector 0.17 by @bbrala in #238
- Simplify codebase: replace EntityLoadBase with configurable rule by @bbrala in #228
- Refactor AssertLegacyTraitBase and ConstantToClassConstantBase to configurable rule by @bbrala in #229
- Improve AssertNoFieldByIdRector by @mglaman in #213
- Create FunctionToServiceRector to replace all function to service call deprecations by @bbrala in #242
- New StaticToFunctionRector to replace StaticToFunctionBase by @bbrala in #243
- Remove single use FunctionToImmutableConfigBase by @bbrala in #245
- StaticArgumentRenameBase and DrupalServiceRenameBase are now covered with StaticArgumentRenameRector by @bbrala in #241
- New ExtensionPathRector to replace ExtensionPathBase by @bbrala in #244
- New DBRector to replace DbBase with configurable rector. by @bbrala in #246
- GetMockRector as configurable rule by @bbrala in #248
- Upgrade to PHPStan level 6 by @bbrala in #249
- MethodToMethodWithCheckRector to replace methods with a certainty check by @bbrala in #247
- Refactor Base\FunctionToStatic to configurable rule. by @bbrala in #251
- Upgrade to Rector 0.18.x by @bbrala in #240
- Refactored BC rules with configuration by @bbrala in #255
- Add better labels to readme by @bbrala in #256
- Add failing unit test for ExtensionPathRector when assining by @bbrala in #258
- Add WatchdogExceptionRector the 10.1 setlist by @bbrala in #263
- PHPUnit deprecations should be checked in Drupal 9 to 10 by @bbrala in #261
- Fix MethodToMethodWithCheckRector by also matching on MethodCall. by @bbrala in #260
- ExtensionPathRector does not handle Assignments by @bbrala in #259
New Contributors
Full Changelog: 0.15.1...0.18.0