Skip to content

Instantly share code, notes, and snippets.

@tedbow
Created April 24, 2020 16:13
Show Gist options
  • Save tedbow/66dbe5eeb108536379381e950cbfc9af to your computer and use it in GitHub Desktop.
Save tedbow/66dbe5eeb108536379381e950cbfc9af to your computer and use it in GitHub Desktop.
weird no rule rector
### Rector changes but with rule mentioned
### vendor/bin/rector process web/modules/abookings/includes/emails.inc --dry-run --verbose
---------- begin diff ----------
--- Original
+++ New
@@ -3,12 +3,11 @@
* @file
* Contains emails abookings.module.
*/
-
/**
* CONTENTS
- *
+ *
* send_booking_email()
- *
+ *
* send_confirmation_email()
* send_provis_booking_email()
* send_prearrival_email()
@@ -16,7 +15,6 @@
* send_expired_booking_email()
* send_completed_booking_email()
*/
-
use Drupal\node\Entity\Node;
@@ -92,7 +90,7 @@
if ($result['result'] != true) {
$message = t('There was a problem sending your email notification to @email, email key: @key.',
array('@email' => $to, '@key' => $key));
- drupal_set_message($message, 'error');
+ \Drupal::messenger()->addError($message);
\Drupal::logger('mail-log')->error($message);
return;
}
@@ -99,7 +97,7 @@
$message = t('An email notification has been sent to @email, email key: @key.',
array('@email' => $to, '@key' => $key));
- drupal_set_message($message);
+ \Drupal::messenger()->addStatus($message);
\Drupal::logger('mail-log')->notice($message);
}
----------- end diff -----------
Applied rules:
* DrupalRector\Rector\Deprecation\DrupalSetMessageRector
### Rector changes but not rule mentioned?
### vendor/bin/rector process web/modules/abookings/modules/booking/booking.module --dry-run --verbose
Rector v0.7.16
Config file: rector.yml
[parsing] web/modules/abookings/modules/booking/booking.module
[refactoring] web/modules/abookings/modules/booking/booking.module
[printing] web/modules/abookings/modules/booking/booking.module
1 file with changes
===================
1) web/modules/abookings/modules/booking/booking.module
---------- begin diff ----------
--- Original
+++ New
@@ -138,9 +138,6 @@
-/**
- *
- */
function get_line_items($booking_nid, $type) {
$l_items = [];
----------- end diff -----------
[OK] Rector is done! 1 file would have changed (dry-run).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment