Make linter/static code analyser happy
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3560053. -->
Reported by: [mxr576](https://www.drupal.org/user/315522)
Related to !25
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>... so other contributions could pass on the automated quality checks as well.</p>
<pre>FILE: src/Vdb/Postgres/Plugin/VdbProvider/PostgresProvider.php<br>------------------------------------------------------------------------------------------------------<br>FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES<br>------------------------------------------------------------------------------------------------------<br> 320 | WARNING | Line exceeds 80 characters; contains 88 characters (Drupal.Files.LineLength.TooLong)<br> 321 | WARNING | Line exceeds 80 characters; contains 89 characters (Drupal.Files.LineLength.TooLong)<br>------------------------------------------------------------------------------------------------------<br>FILE: src/Form/AmazeeioAiConfigForm.php<br>------------------------------------------------------------------------------------------------------------------------<br>FOUND 8 ERRORS AND 1 WARNING AFFECTING 9 LINES<br>------------------------------------------------------------------------------------------------------------------------<br> 235 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing<br> | | parentheses (Drupal.Commenting.InlineComment.InvalidEndChar)<br> 244 | WARNING | [x] A comma should follow the last multiline array item. Found: region<br> | | (Drupal.Arrays.Array.CommaLastItem)<br> 250 | ERROR | [x] Expected newline after closing brace<br> | | (Drupal.ControlStructures.ControlSignature.NewlineAfterCloseBrace)<br> 272 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing<br> | | parentheses (Drupal.Commenting.InlineComment.InvalidEndChar)<br> 278 | ERROR | [x] Array indentation error, expected 10 spaces but found 14 (Drupal.Arrays.Array.ArrayIndentation)<br> 279 | ERROR | [x] Array indentation error, expected 10 spaces but found 14 (Drupal.Arrays.Array.ArrayIndentation)<br> 280 | ERROR | [x] Array indentation error, expected 10 spaces but found 14 (Drupal.Arrays.Array.ArrayIndentation)<br> 281 | ERROR | [x] Array indentation error, expected 10 spaces but found 12 (Drupal.Arrays.Array.ArrayIndentation)<br> 541 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing<br> | | parentheses (Drupal.Commenting.InlineComment.InvalidEndChar)<br>------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------------<br>FILE: src/AmazeeIoApi/ClientInterface.php<br>------------------------------------------------------------------------------------------------------------------------<br>FOUND 2 ERRORS AFFECTING 2 LINES<br>------------------------------------------------------------------------------------------------------------------------<br> 131 | ERROR | [x] Expected 1 blank line after function; 0 found (Squiz.WhiteSpace.FunctionSpacing.AfterLast)<br> 132 | ERROR | [x] The closing brace for the interface must have an empty line before it<br> | | (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)<br>------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------------<br>FILE: src/AmazeeIoApi/AmazeeClient.php<br>------------------------------------------------------------------------------------------------------------------------<br>FOUND 2 ERRORS AFFECTING 2 LINES<br>------------------------------------------------------------------------------------------------------------------------<br> 276 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing<br> | | parentheses (Drupal.Commenting.InlineComment.InvalidEndChar)<br> 354 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8 (Drupal.WhiteSpace.ScopeIndent.IncorrectExact)<br>------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------------<br>FILE: ai_provider_amazeeio.module<br>------------------------------------------------------------------------------------------------------------------------<br>FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 6 LINES<br>------------------------------------------------------------------------------------------------------------------------<br> 54 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters (Drupal.Files.LineLength.TooLong)<br> 70 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph<br> | | (Drupal.Commenting.DocComment.ShortSingleLine)<br> 77 | ERROR | [x] Documentation comment contains forbidden comment "after they completed the execution..".<br> | | (SlevomatCodingStandard.Commenting.ForbiddenComments.CommentForbidden)<br> 79 | ERROR | [ ] Description for the @return value is missing<br> | | (Drupal.Commenting.FunctionComment.MissingReturnComment)<br> 87 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters (Drupal.Files.LineLength.TooLong)<br> 92 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters (Drupal.Files.LineLength.TooLong)<br>------------------------------------------------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY<br>------------------------------------------------------------------------------------------------------------------------<br>Time: 505ms; Memory: 8MB<br>PHP CODE SNIFFER REPORT SUMMARY<br>-----------------------------------------------------------------------------<br>FILE ERRORS WARNINGS<br>-----------------------------------------------------------------------------<br>ai_provider_amazeeio.module 3 3<br>src/AmazeeIoApi/AmazeeClient.php 2 0<br>src/AmazeeIoApi/ClientInterface.php 2 0<br>src/Form/AmazeeioAiConfigForm.php 8 1<br>src/Vdb/Postgres/Plugin/VdbProvider/PostgresProvider.php 0 2<br>-----------------------------------------------------------------------------<br>A TOTAL OF 15 ERRORS AND 6 WARNINGS WERE FOUND IN 33 FILES<br>-----------------------------------------------------------------------------<br>PHPCBF CAN FIX 14 OF THESE SNIFF VIOLATIONS AUTOMATICALLY<br>-----------------------------------------------------------------------------<br>PHP CODE SNIFFER VIOLATION SOURCE SUMMARY<br>-------------------------------------------------------------------------------<br> SOURCE COUNT<br>-------------------------------------------------------------------------------<br>[ ] Drupal.Files.LineLength.TooLong 5<br>[x] Drupal.Arrays.Array.ArrayIndentation 4<br>[x] Drupal.Commenting.InlineComment.InvalidEndChar 4<br>[x] Drupal.Arrays.Array.CommaLastItem 1<br>[x] Drupal.Classes.ClassDeclaration.CloseBraceAfterBody 1<br>[ ] Drupal.Commenting.DocComment.ShortSingleLine 1<br>[ ] Drupal.Commenting.FunctionComment.MissingReturnComment 1<br>[x] Drupal.ControlStructures.ControlSignature.NewlineAfterCloseBrace 1<br>[x] Drupal.WhiteSpace.ScopeIndent.IncorrectExact 1<br>[x] SlevomatCodingStandard.Commenting.ForbiddenComments.CommentForbidden 1<br>[x] Squiz.WhiteSpace.FunctionSpacing.AfterLast 1<br>-------------------------------------------------------------------------------<br>A TOTAL OF 21 SNIFF VIOLATIONS WERE FOUND IN 11 SOURCES<br>-------------------------------------------------------------------------------<br>PHPCBF CAN FIX THE 8 MARKED SOURCES AUTOMATICALLY (14 VIOLATIONS IN TOTAL)<br>-------------------------------------------------------------------------------</pre><pre>Note: Using configuration file /builds/issue/ai_provider_amazeeio-3560029/web/modules/custom/ai_provider_amazeeio/phpstan.neon.<br> ------ ---------------------------------------------------------------------- <br> Line src/AmazeeIoApi/AmazeeClient.php <br> ------ ---------------------------------------------------------------------- <br> 58 \Drupal calls should be avoided in classes, use dependency injection <br> instead <br> 🪪 globalDrupalDependencyInjection.useDependencyInjection <br> ------ ---------------------------------------------------------------------- <br> ------ ---------------------------------------------------------------------- <br> Line src/Form/AmazeeioAiConfigForm.php <br> ------ ---------------------------------------------------------------------- <br> 273 \Drupal calls should be avoided in classes, use dependency injection <br> instead <br> 🪪 globalDrupalDependencyInjection.useDependencyInjection <br> 542 \Drupal calls should be avoided in classes, use dependency injection <br> instead <br> 🪪 globalDrupalDependencyInjection.useDependencyInjection <br> ------ ---------------------------------------------------------------------- <br> ------ ---------------------------------------------------------------------- <br> Line src/Plugin/VdbProvider/AmazeeioVdbProvider.php <br> ------ ---------------------------------------------------------------------- <br> 118 \Drupal calls should be avoided in classes, use dependency injection <br> instead <br> 🪪 globalDrupalDependencyInjection.useDependencyInjection <br> ------ ---------------------------------------------------------------------- <br> ------ ---------------------------------------------------------------------- <br> Line src/Vdb/Postgres/Plugin/VdbProvider/PostgresProvider.php <br> ------ ---------------------------------------------------------------------- <br> 387 \Drupal calls should be avoided in classes, use dependency injection <br> instead <br> 🪪 globalDrupalDependencyInjection.useDependencyInjection <br> ------ ---------------------------------------------------------------------- <br> [ERROR] Found 5 errors </pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue