Drupal Coding Standard.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3321490. -->
Reported by: [rohit rana](https://www.drupal.org/user/3709675)
Related to !38
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<pre>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/tests/src/Functional/ModerationDashboardPermissionTest.php<br>-----------------------------------------------------------------------------------------------------------------------------------------<br>FOUND 9 ERRORS AFFECTING 9 LINES<br>-----------------------------------------------------------------------------------------------------------------------------------------<br> 55 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines<br> 113 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 116 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 120 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 121 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 164 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 168 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 186 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br> 194 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines<br>-----------------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/tests/src/Functional/ModerationDashboardRedirectTest.php<br>---------------------------------------------------------------------------------------------------------------------------------------------<br>FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES<br>---------------------------------------------------------------------------------------------------------------------------------------------<br> 32 | ERROR | [x] Comments may not appear after statements<br> 33 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead<br> 46 | ERROR | [x] Comments may not appear after statements<br> 47 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead<br>---------------------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>---------------------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/js/moderation_dashboard_activity.js<br>------------------------------------------------------------------------------------------------------------------<br>FOUND 14 ERRORS AFFECTING 1 LINE<br>------------------------------------------------------------------------------------------------------------------<br> 18 | ERROR | [x] Expected 1 space before "<"; 0 found<br> 18 | ERROR | [x] Expected 1 space after "<"; 0 found<br> 18 | ERROR | [x] Expected 1 space before "="; 0 found<br> 18 | ERROR | [x] Expected 1 space after "="; 0 found<br> 18 | ERROR | [x] Expected 1 space before "="; 0 found<br> 18 | ERROR | [x] Expected 1 space after "="; 0 found<br> 18 | ERROR | [x] Expected 1 space before ">"; 0 found<br> 18 | ERROR | [x] Expected 1 space after ">"; 0 found<br> 18 | ERROR | [x] Expected 1 space before "<"; 0 found<br> 18 | ERROR | [x] Expected 1 space after "<"; 0 found<br> 18 | ERROR | [x] Expected 1 space before "/"; 0 found<br> 18 | ERROR | [x] Expected 1 space after "/"; 0 found<br> 18 | ERROR | [x] Expected 1 space before ">"; 0 found<br> 18 | ERROR | [x] Expected 1 space after ">"; 0 found<br>------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/src/Form/SettingsForm.php<br>--------------------------------------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE<br>--------------------------------------------------------------------------------------------------------<br> 43 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead<br>--------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/src/Plugin/Condition/ModerationDashboardAccess.php<br>---------------------------------------------------------------------------------------------------------------------------------<br>FOUND 1 ERROR AFFECTING 1 LINE<br>---------------------------------------------------------------------------------------------------------------------------------<br> 25 | ERROR | Missing member variable doc comment<br>---------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/src/Plugin/Block/ModerationDashboardActivity.php<br>-------------------------------------------------------------------------------------------------------------------------------<br>FOUND 2 ERRORS AFFECTING 2 LINES<br>-------------------------------------------------------------------------------------------------------------------------------<br> 118 | ERROR | [x] Use null coalesce operator instead of ternary operator.<br> 120 | ERROR | [x] Use null coalesce operator instead of ternary operator.<br>-------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/src/Plugin/views/field/LinkToLatestVersion.php<br>-----------------------------------------------------------------------------------------------------------------------------<br>FOUND 1 ERROR AFFECTING 1 LINE<br>-----------------------------------------------------------------------------------------------------------------------------<br> 53 | ERROR | [x] Expected 1 blank line after function; 2 found<br>-----------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-----------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/moderation_dashboard/src/Routing/ResponseSubscriber.php<br>-----------------------------------------------------------------------------------------------------------------<br>FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES<br>-----------------------------------------------------------------------------------------------------------------<br> 12 | WARNING | [x] Unused use statement<br> 63 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements<br>-----------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-----------------------------------------------------------------------------------------------------------------<br><br>Time: 261ms; Memory: 12MB</pre>
issue
GitLab AI Context
Project: project/moderation_dashboard
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/moderation_dashboard/-/raw/2.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/moderation_dashboard
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD