Coding standards
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3189093. -->
Reported by: [jcnventura](https://www.drupal.org/user/122464)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<pre>FILE: /home/jcv/drupal/git/content_templates/src/Entity/ContentTemplate.php<br>---------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE<br>---------------------------------------------------------------------------<br> 5 | WARNING | [x] Unused use statement<br>---------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>---------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/Controller/TemplateAccess.php<br>----------------------------------------------------------------------------------------------------------------------------------------------<br>FOUND 8 ERRORS AND 1 WARNING AFFECTING 8 LINES<br>----------------------------------------------------------------------------------------------------------------------------------------------<br> 10 | ERROR | [x] Doc comment short description must end with a full stop<br> 13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name<br> 16 | ERROR | [ ] Missing short description in doc comment<br> 17 | ERROR | [ ] Missing parameter comment<br> 18 | ERROR | [ ] Missing parameter comment<br> 18 | ERROR | [ ] Missing parameter type<br> 20 | ERROR | [ ] Description for the @return value is missing<br> 25 | ERROR | [ ] The array declaration line has 137 characters (the limit is 80). The array content should be split up over multiple lines<br> 26 | ERROR | [x] Expected newline after closing brace<br>----------------------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>----------------------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/Controller/TemplateController.php<br>-------------------------------------------------------------------------------------------------------------------------------<br>FOUND 12 ERRORS AND 5 WARNINGS AFFECTING 17 LINES<br>-------------------------------------------------------------------------------------------------------------------------------<br> 11 | ERROR | [x] Doc comment short description must end with a full stop<br> 14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name<br> 32 | ERROR | [x] Expected newline after closing brace<br> 37 | ERROR | [ ] Missing short description in doc comment<br> 38 | ERROR | [ ] Missing parameter comment<br> 40 | ERROR | [ ] Description for the @return value is missing<br> 49 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses<br> 62 | ERROR | [ ] Missing parameter comment<br> 64 | ERROR | [ ] Description for the @return value is missing<br> 65 | ERROR | [x] Separate the @return and @throws sections by a blank line.<br> 81 | ERROR | [ ] Missing short description in doc comment<br> 82 | ERROR | [ ] Description for the @return value is missing<br> 99 | WARNING | [x] A comma should follow the last multiline array item. Found: 'user.permissions'<br> 100 | WARNING | [x] A comma should follow the last multiline array item. Found: ]<br> 103 | WARNING | [x] A comma should follow the last multiline array item. Found: 'content_templates/admin'<br> 104 | WARNING | [x] A comma should follow the last multiline array item. Found: ]<br> 129 | ERROR | [x] Expected newline after closing brace<br>-------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/ContentTemplateListBuilder.php<br>-------------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE<br>-------------------------------------------------------------------------------<br> 29 | WARNING | [x] Inline @var declarations should use the /** */ delimiters<br>-------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/Form/ContentTemplateDeleteForm.php<br>-----------------------------------------------------------------------------------<br>FOUND 2 ERRORS AFFECTING 1 LINE<br>-----------------------------------------------------------------------------------<br> 12 | ERROR | [x] There should be no white space after an opening "{"<br> 12 | ERROR | [x] There should be no white space before a closing "}"<br>-----------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>-----------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/Form/NodeDeleteForm.php<br>----------------------------------------------------------------------------------------------------------------------------------------------<br>FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES<br>----------------------------------------------------------------------------------------------------------------------------------------------<br> 3 | ERROR | [x] There must be one blank line after the namespace declaration<br> 10 | ERROR | [x] Doc comment short description must end with a full stop<br> 13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name<br> 19 | ERROR | [ ] Description for the @return value is missing<br> 20 | ERROR | [x] Separate the @return and @throws sections by a blank line.<br> 33 | ERROR | [ ] The array declaration line has 268 characters (the limit is 80). The array content should be split up over multiple lines<br>----------------------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>----------------------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/src/Form/ContentTemplateForm.php<br>------------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE<br>------------------------------------------------------------------------------<br> 37 | WARNING | [x] Inline @var declarations should use the /** */ delimiters<br>------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/content_templates.module<br>------------------------------------------------------------------------------------------------------------------------------<br>FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES<br>------------------------------------------------------------------------------------------------------------------------------<br> 1 | ERROR | [x] Missing file doc comment<br> 55 | WARNING | [x] The variable name should be defined after the type<br> 82 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses<br>------------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------------------<br><br><br>FILE: /home/jcv/drupal/git/content_templates/content_templates.page.inc<br>------------------------------------------------------------------------------------------<br>FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES<br>------------------------------------------------------------------------------------------<br> 31 | ERROR | [x] The first index in a multi-value array must be on a new line<br> 34 | WARNING | [x] A comma should follow the last multiline array item. Found: target_id<br> 36 | ERROR | [x] Array indentation error, expected 4 spaces but found 2<br> 36 | ERROR | [x] Closing parenthesis of array declaration must be on a new line<br>------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------</pre>
issue
GitLab AI Context
Project: project/content_templates
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/content_templates/-/raw/1.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/content_templates
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