|
1 |
| -# 52 Rules Overview |
| 1 | +# 54 Rules Overview |
2 | 2 |
|
3 | 3 | <br>
|
4 | 4 |
|
5 | 5 | ## Categories
|
6 | 6 |
|
7 |
| -- [Drupal10](#drupal10) (2) |
| 7 | +- [Drupal10](#drupal10) (3) |
8 | 8 |
|
9 | 9 | - [Drupal8](#drupal8) (18)
|
10 | 10 |
|
11 | 11 | - [Drupal9](#drupal9) (26)
|
12 | 12 |
|
13 |
| -- [DrupalRector](#drupalrector) (6) |
| 13 | +- [DrupalRector](#drupalrector) (7) |
14 | 14 |
|
15 | 15 | <br>
|
16 | 16 |
|
17 | 17 | ## Drupal10
|
18 | 18 |
|
| 19 | +### AnnotationToAttributeRector |
| 20 | + |
| 21 | +Change annotations with value to attribute |
| 22 | + |
| 23 | +:wrench: **configure it!** |
| 24 | + |
| 25 | +- class: [`DrupalRector\Drupal10\Rector\Deprecation\AnnotationToAttributeRector`](../src/Drupal10/Rector/Deprecation/AnnotationToAttributeRector.php) |
| 26 | + |
| 27 | +```diff |
| 28 | + namespace Drupal\Core\Action\Plugin\Action; |
| 29 | + |
| 30 | ++use Drupal\Core\Action\Plugin\Action\Derivative\EntityPublishedActionDeriver; |
| 31 | ++use Drupal\Core\Action\Attribute\Action; |
| 32 | + use Drupal\Core\Session\AccountInterface; |
| 33 | ++use Drupal\Core\StringTranslation\TranslatableMarkup; |
| 34 | + |
| 35 | + /** |
| 36 | + * Publishes an entity. |
| 37 | +- * |
| 38 | +- * @Action( |
| 39 | +- * id = "entity:publish_action", |
| 40 | +- * action_label = @Translation("Publish"), |
| 41 | +- * deriver = "Drupal\Core\Action\Plugin\Action\Derivative\EntityPublishedActionDeriver", |
| 42 | +- * ) |
| 43 | + */ |
| 44 | ++#[Action( |
| 45 | ++ id: 'entity:publish_action', |
| 46 | ++ action_label: new TranslatableMarkup('Publish'), |
| 47 | ++ deriver: EntityPublishedActionDeriver::class |
| 48 | ++)] |
| 49 | + class PublishAction extends EntityActionBase { |
| 50 | +``` |
| 51 | + |
| 52 | +<br> |
| 53 | + |
19 | 54 | ### SystemTimeZonesRector
|
20 | 55 |
|
21 | 56 | Fixes deprecated `system_time_zones()` calls
|
@@ -843,6 +878,25 @@ Fixes deprecated `user_password()` calls
|
843 | 878 |
|
844 | 879 | ## DrupalRector
|
845 | 880 |
|
| 881 | +### ClassConstantToClassConstantRector |
| 882 | + |
| 883 | +Fixes deprecated class contant use, used in Drupal 9.1 deprecations |
| 884 | + |
| 885 | +:wrench: **configure it!** |
| 886 | + |
| 887 | +- class: [`DrupalRector\Rector\Deprecation\ClassConstantToClassConstantRector`](../src/Rector/Deprecation/ClassConstantToClassConstantRector.php) |
| 888 | + |
| 889 | +```diff |
| 890 | +-$value = Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME; |
| 891 | +-$value2 = Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT; |
| 892 | +-$value3 = Symfony\Cmf\Component\Routing\RouteObjectInterface::CONTROLLER_NAME; |
| 893 | ++$value = \Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME; |
| 894 | ++$value2 = \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT; |
| 895 | ++$value3 = \Drupal\Core\Routing\RouteObjectInterface::CONTROLLER_NAME; |
| 896 | +``` |
| 897 | + |
| 898 | +<br> |
| 899 | + |
846 | 900 | ### ConstantToClassConstantRector
|
847 | 901 |
|
848 | 902 | Fixes deprecated contant use, used in Drupal 8 and 9 deprecations
|
|
0 commit comments