Skip to content

Commit

Permalink
Refactor old rules to new configuration object
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrala committed Apr 20, 2024
1 parent 5bd0087 commit 7f08987
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions config/drupal-8/drupal-8.0-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@

$rectorConfig->ruleWithConfiguration(FunctionToServiceRector::class, [
// https://www.drupal.org/node/2418133
new FunctionToServiceConfiguration('drupal_realpath', 'file_system', 'realpath'),
new FunctionToServiceConfiguration('8.0.0', 'drupal_realpath', 'file_system', 'realpath'),
// https://www.drupal.org/node/2912696
new FunctionToServiceConfiguration('drupal_render', 'renderer', 'render'),
new FunctionToServiceConfiguration('8.0.0', 'drupal_render', 'renderer', 'render'),
// https://www.drupal.org/node/2912696
new FunctionToServiceConfiguration('drupal_render_root', 'renderer', 'renderRoot'),
new FunctionToServiceConfiguration('8.0.0', 'drupal_render_root', 'renderer', 'renderRoot'),
// https://www.drupal.org/node/1876852
new FunctionToServiceConfiguration('format_date', 'date.formatter', 'format'),
new FunctionToServiceConfiguration('8.0.0', 'format_date', 'date.formatter', 'format'),
]);

$rectorConfig->rule(EntityInterfaceLinkRector::class);
Expand Down
4 changes: 2 additions & 2 deletions config/drupal-8/drupal-8.7-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
});
$rectorConfig->ruleWithConfiguration(FunctionToServiceRector::class, [
// https://www.drupal.org/node/3006851
new FunctionToServiceConfiguration('file_prepare_directory', 'file_system', 'prepareDirectory'),
new FunctionToServiceConfiguration('8.7.0', 'file_prepare_directory', 'file_system', 'prepareDirectory'),
// https://www.drupal.org/node/3006851
new FunctionToServiceConfiguration('file_unmanaged_save_data', 'file_system', 'saveData'),
new FunctionToServiceConfiguration('8.7.0', 'file_unmanaged_save_data', 'file_system', 'saveData'),
]);

/**
Expand Down
10 changes: 5 additions & 5 deletions config/drupal-8/drupal-8.8-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
$rectorConfig->ruleWithConfiguration(FunctionToServiceRector::class,
[
// https://www.drupal.org/node/2835616
new FunctionToServiceConfiguration('entity_get_display', 'entity_display.repository', 'getViewDisplay'),
new FunctionToServiceConfiguration('8.8.0', 'entity_get_display', 'entity_display.repository', 'getViewDisplay'),
// https://www.drupal.org/node/2835616
new FunctionToServiceConfiguration('entity_get_form_display', 'entity_display.repository', 'getFormDisplay'),
new FunctionToServiceConfiguration('8.8.0', 'entity_get_form_display', 'entity_display.repository', 'getFormDisplay'),
// https://www.drupal.org/node/3039255
new FunctionToServiceConfiguration('file_directory_temp', 'file_system', 'getTempDirectory'),
new FunctionToServiceConfiguration('8.8.0', 'file_directory_temp', 'file_system', 'getTempDirectory'),
// https://www.drupal.org/node/3038437
new FunctionToServiceConfiguration('file_scan_directory', 'file_system', 'scanDirectory'),
new FunctionToServiceConfiguration('8.8.0', 'file_scan_directory', 'file_system', 'scanDirectory'),
// https://www.drupal.org/node/3035273
new FunctionToServiceConfiguration('file_uri_target', 'stream_wrapper_manager', 'getTarget'),
new FunctionToServiceConfiguration('8.8.0', 'file_uri_target', 'stream_wrapper_manager', 'getTarget'),
]);

$rectorConfig->ruleWithConfiguration(MethodToMethodWithCheckRector::class, [
Expand Down
8 changes: 4 additions & 4 deletions config/drupal-9/drupal-9.3-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

// Change record: https://www.drupal.org/node/3223520
$rectorConfig->ruleWithConfiguration(FunctionToServiceRector::class, [
new FunctionToServiceConfiguration('file_copy', 'file.repository', 'copy'),
new FunctionToServiceConfiguration('file_move', 'file.repository', 'move'),
new FunctionToServiceConfiguration('file_save_data', 'file.repository', 'writeData'),
new FunctionToServiceConfiguration('9.3.0', 'file_copy', 'file.repository', 'copy'),
new FunctionToServiceConfiguration('9.3.0', 'file_move', 'file.repository', 'move'),
new FunctionToServiceConfiguration('9.3.0', 'file_save_data', 'file.repository', 'writeData'),
// Change record: https://www.drupal.org/node/2939099
new FunctionToServiceConfiguration('render', 'renderer', 'render'),
new FunctionToServiceConfiguration('9.3.0', 'render', 'renderer', 'render'),
]);

// Change record: https://www.drupal.org/node/3223091.
Expand Down

0 comments on commit 7f08987

Please sign in to comment.