Created
May 5, 2020 15:06
-
-
Save nerdstein/db11132d37e6d21763d899a0107e7d44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rector 0.8.x-dev@8896f0a | |
| Config file: rector.yml | |
| 40 files with changes | |
| ===================== | |
| .... | |
| 7) drupal-rector/rector_examples/drupal_set_message.php | |
| ---------- begin diff ---------- | |
| --- Original | |
| +++ New | |
| @@ -8,7 +8,7 @@ | |
| * A simple example using the minimum number of arguments. | |
| */ | |
| function simple_example() { | |
| - drupal_set_message('example message'); | |
| + \Drupal::messenger()->addStatus('example message'); | |
| } | |
| /** | |
| @@ -15,7 +15,7 @@ | |
| * An example using all of the arguments. | |
| */ | |
| function using_all_arguments() { | |
| - drupal_set_message('example warning', 'status', TRUE); | |
| + \Drupal::messenger()->addStatus('example warning', TRUE); | |
| } | |
| /** | |
| @@ -22,11 +22,11 @@ | |
| * Examples that show situations where we define the type of message. | |
| */ | |
| function message_types() { | |
| - drupal_set_message('example error', 'error'); | |
| + \Drupal::messenger()->addError('example error'); | |
| - drupal_set_message('example status', 'status'); | |
| + \Drupal::messenger()->addStatus('example status'); | |
| - drupal_set_message('example warning', 'warning'); | |
| + \Drupal::messenger()->addWarning('example warning'); | |
| } | |
| /** | |
| ----------- end diff ----------- | |
| Applied rules: | |
| * DrupalRector\Rector\Deprecation\DrupalSetMessageRector | |
| .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment