Fix the issues reported by PHP_CodeSniffer

Created on 24 September 2024, 2 months ago

Problem/Motivation

FILE: modules\prefetcher\prefetcher.drush.inc
-----------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] Doc comment short description must be on the first line
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: modules\prefetcher\prefetcher.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\prefetcher.install
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
5 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\BaseFieldDefinition.
26 | ERROR | [ ] The array declaration extends to column 147 (the limit is 120). The array content should be split up over multiple lines
47 | ERROR | [x] Short array syntax must be used to define arrays
52 | ERROR | [x] Short array syntax must be used to define arrays
69 | ERROR | [x] Expected newline after closing brace
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\prefetcher.links.menu.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
14 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: modules\prefetcher\prefetcher.module
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------
18 | ERROR | There must be no space between ? and :
20 | ERROR | The array declaration extends to column 128 (the limit is 120). The array content should be split up over multiple lines
59 | ERROR | The array declaration extends to column 170 (the limit is 120). The array content should be split up over multiple lines
213 | ERROR | Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Commands\PrefetcherCommands.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
44 | ERROR | [ ] The array declaration extends to column 130 (the limit is 120). The array content should be split up over multiple lines
52 | ERROR | [x] Doc comment star missing
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Controller\CrawlController.php
------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
18 | ERROR | [ ] Missing short description in doc comment
19 | ERROR | [x] Do not append variable name "$crawler_manager" to the type declaration in a member variable comment
21 | ERROR | [ ] Class property $crawler_manager should use lowerCamel naming without underscores
26 | ERROR | [ ] Description for the @return value is missing
39 | ERROR | [x] Missing function doc comment
48 | ERROR | [ ] Missing short description in doc comment
49 | ERROR | [ ] Description for the @return value is missing
55 | ERROR | [ ] Missing short description in doc comment
56 | ERROR | [ ] Missing parameter comment
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\CrawlerInterface.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 23 ERRORS AFFECTING 17 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Plugin\PluginInspectionInterface.
22 | ERROR | [ ] Parameter comment must start with a capital letter
22 | ERROR | [x] Data types in @param tags need to be fully namespaced
22 | ERROR | [x] Parameter comment must be on the next line
22 | ERROR | [x] Parameter comment must end with a full stop
24 | ERROR | [x] Expected 1 blank line before function; 0 found
29 | ERROR | [ ] Parameter comment must start with a capital letter
29 | ERROR | [x] Data types in @param tags need to be fully namespaced
29 | ERROR | [x] Parameter comment must be on the next line
29 | ERROR | [x] Parameter comment must end with a full stop
41 | ERROR | [ ] Missing short description in doc comment
42 | ERROR | [ ] Missing parameter comment
43 | ERROR | [ ] Missing parameter comment
44 | ERROR | [ ] Missing parameter comment
46 | ERROR | [ ] Description for the @return value is missing
50 | ERROR | [ ] Missing short description in doc comment
51 | ERROR | [ ] Missing parameter comment
52 | ERROR | [ ] Missing parameter comment
54 | ERROR | [ ] Description for the @return value is missing
58 | ERROR | [ ] Missing short description in doc comment
59 | ERROR | [ ] Missing parameter comment
60 | ERROR | [ ] Missing parameter comment
62 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Entity\PrefetcherUri.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 30 ERRORS AND 1 WARNING AFFECTING 31 LINES
----------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityBase.
9 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
63 | WARNING | [ ] Possible useless method overriding detected
65 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
66 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
67 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
136 | ERROR | [x] There should be no white space before a closing ")"
140 | ERROR | [x] Short array syntax must be used to define arrays
145 | ERROR | [x] Short array syntax must be used to define arrays
156 | ERROR | [x] Short array syntax must be used to define arrays
161 | ERROR | [x] Short array syntax must be used to define arrays
182 | ERROR | [x] Short array syntax must be used to define arrays
187 | ERROR | [x] Short array syntax must be used to define arrays
198 | ERROR | [x] Short array syntax must be used to define arrays
203 | ERROR | [x] Short array syntax must be used to define arrays
214 | ERROR | [x] Short array syntax must be used to define arrays
219 | ERROR | [x] Short array syntax must be used to define arrays
230 | ERROR | [x] Short array syntax must be used to define arrays
235 | ERROR | [x] Short array syntax must be used to define arrays
241 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 3 empty lines
243 | ERROR | [ ] More than 2 empty lines are not allowed
247 | ERROR | [x] Short array syntax must be used to define arrays
257 | ERROR | [x] Short array syntax must be used to define arrays
262 | ERROR | [x] Short array syntax must be used to define arrays
272 | ERROR | [x] Short array syntax must be used to define arrays
277 | ERROR | [x] Short array syntax must be used to define arrays
286 | ERROR | [x] Short array syntax must be used to define arrays
291 | ERROR | [x] Short array syntax must be used to define arrays
301 | ERROR | [x] Missing function doc comment
304 | ERROR | [x] Expected newline after closing brace
310 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Entity\PrefetcherUriInterface.php
--------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 3 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
15 | ERROR | [x] Expected 1 space before "ContentEntityInterface"; 2 found
25 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
36 | ERROR | [x] Perl-style comments are not allowed; use "// Comment" instead
71 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
83 | ERROR | [x] Missing function doc comment
83 | ERROR | [x] Expected 1 blank line after function; 0 found
84 | ERROR | [x] Missing function doc comment
84 | ERROR | [x] Expected 1 blank line after function; 0 found
85 | ERROR | [x] Missing function doc comment
85 | ERROR | [x] Expected 1 blank line after function; 0 found
86 | ERROR | [x] Missing function doc comment
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Entity\PrefetcherUriType.php
----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------
8 | ERROR | [x] Doc comment short description must end with a full stop
19 | ERROR | [ ] Class property $persistent_cache should use lowerCamel naming without underscores
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Entity\PrefetcherUriViewsData.php
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------------
19 | WARNING | [x] There must be no blank line following an inline comment
21 | ERROR | [x] Short array syntax must be used to define arrays
23 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Form\ImportPrefetcherUrisForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 1 WARNING AFFECTING 15 LINES
----------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Environment.
14 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
37 | ERROR | [x] Short array syntax must be used to define arrays
41 | ERROR | [x] Short array syntax must be used to define arrays
49 | ERROR | [x] Short array syntax must be used to define arrays
54 | ERROR | [x] Short array syntax must be used to define arrays
59 | ERROR | [x] Short array syntax must be used to define arrays
60 | ERROR | [x] Short array syntax must be used to define arrays
61 | ERROR | [x] Short array syntax must be used to define arrays
63 | ERROR | [x] Short array syntax must be used to define arrays
66 | ERROR | [x] Short array syntax must be used to define arrays
104 | ERROR | [x] Short array syntax must be used to define arrays
105 | ERROR | [x] Short array syntax must be used to define arrays
106 | ERROR | [x] Short array syntax must be used to define arrays
107 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Form\ImportSitemapForm.php
-------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
-------------------------------------------------------------------------------
18 | ERROR | [ ] Missing short description in doc comment
23 | ERROR | [ ] Missing short description in doc comment
35 | ERROR | [x] Missing function doc comment
43 | ERROR | [ ] Missing short description in doc comment
44 | ERROR | [ ] Missing parameter comment
50 | ERROR | [ ] Missing short description in doc comment
51 | ERROR | [ ] Missing parameter comment
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Form\PrefetcherConfigForm.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormBuilderInterface.
17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
70 | ERROR | [ ] Missing short description in doc comment
71 | ERROR | [x] Expected "\Drupal\Core\Config\Config" but found "\Drupal\Core\Config\Config|\Drupal\Core\Config\Config" for function return type
71 | ERROR | [ ] Description for the @return value is missing
190 | ERROR | [x] Expected 1 space before "+"; 0 found
190 | ERROR | [x] Expected 1 space after "+"; 0 found
221 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Form\PrefetcherUriForm.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------
19 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Form\PrefetcherUriSettingsForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
14 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Plugin\PrefetcherCrawler\CrawlerBasic.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 44 ERRORS AND 4 WARNINGS AFFECTING 36 LINES
-------------------------------------------------------------------------------------------------------------------------------
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is GuzzleHttp\Client.
15 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
29 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
49 | ERROR | [x] Do not append variable name "$requestOptions" to the type declaration in a member variable comment
108 | ERROR | [x] Missing function doc comment
112 | ERROR | [x] Missing function doc comment
117 | ERROR | [x] Missing function doc comment
154 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
169 | ERROR | [x] Expected 1 space before "="; 0 found
169 | ERROR | [x] Expected 1 space after "="; 0 found
183 | ERROR | [x] Missing function doc comment
201 | ERROR | [x] Expected 1 space before "="; 0 found
201 | ERROR | [x] Expected 1 space after "="; 0 found
205 | ERROR | [x] Expected 1 space after cast statement; 0 found
206 | ERROR | [x] Expected 1 space after cast statement; 0 found
207 | ERROR | [x] Expected 1 space after cast statement; 0 found
219 | ERROR | [ ] Missing parameter comment
220 | ERROR | [x] Separate the @param and @return sections by a blank line.
220 | ERROR | [ ] Return type "array contains uri and prefetcher_uri entity" must not contain spaces
221 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
222 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
227 | ERROR | [x] Return comment indentation must be 3 spaces, found 1 spaces
230 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
259 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
261 | ERROR | [x] Use null coalesce operator instead of ternary operator.
262 | ERROR | [x] Concat operator must be surrounded by a single space
262 | ERROR | [x] Concat operator must be surrounded by a single space
290 | ERROR | [ ] Missing short description in doc comment
291 | ERROR | [x] Expected 1 spaces after parameter type; 31 found
291 | ERROR | [x] Parameter comment must be on the next line
291 | ERROR | [x] Parameter comment must end with a full stop
292 | ERROR | [x] Expected 1 spaces after parameter type; 32 found
292 | ERROR | [x] Parameter comment must be on the next line
293 | ERROR | [x] Expected 1 spaces after parameter type; 32 found
293 | ERROR | [x] Parameter comment must be on the next line
293 | ERROR | [x] Parameter comment must end with a full stop
294 | ERROR | [x] Parameter comment must be on the next line
294 | ERROR | [x] Parameter comment must end with a full stop
295 | ERROR | [x] Expected 1 spaces after parameter type; 31 found
295 | ERROR | [x] Parameter comment must be on the next line
295 | ERROR | [x] Parameter comment must end with a full stop
297 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
318 | ERROR | [x] Data types in @var tags need to be fully namespaced
327 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
377 | ERROR | [x] Use null coalesce operator instead of ternary operator.
428 | ERROR | [x] Missing function doc comment
432 | ERROR | [x] Missing function doc comment
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 42 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Plugin\views\field\PrefetcherLabel.php
-----------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
5 | ERROR | [x] Doc comment short description must end with a full stop
22 | ERROR | [ ] Missing short description in doc comment
30 | ERROR | [x] Doc comment short description must end with a full stop
31 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
31 | ERROR | [ ] Description for the @return value is missing
36 | ERROR | [x] Expected 1 blank line after function; 2 found
39 | ERROR | [ ] Missing short description in doc comment
45 | ERROR | [x] Expected 1 newline at end of file; 0 found
45 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\PrefetcherCrawlerManager.php
-------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------
70 | ERROR | [x] Missing function doc comment
93 | ERROR | [x] Short array syntax must be used to define arrays
101 | ERROR | [x] Expected 1 blank line after function; 0 found
102 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------

FILE: Cmodules\prefetcher\src\PrefetcherImporterService.php
----------------------------------------------------------------------------------------------------------------------
FOUND 26 ERRORS AND 4 WARNINGS AFFECTING 26 LINES
----------------------------------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
15 | ERROR | [ ] Missing member variable doc comment
20 | ERROR | [ ] Missing parameter comment
20 | ERROR | [ ] Missing parameter type
21 | ERROR | [ ] Missing parameter comment
21 | ERROR | [ ] Missing parameter type
74 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
76 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
121 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
123 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
126 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
129 | ERROR | [x] Short array syntax must be used to define arrays
134 | ERROR | [x] Short array syntax must be used to define arrays
150 | ERROR | [x] Short array syntax must be used to define arrays
155 | ERROR | [x] Short array syntax must be used to define arrays
176 | ERROR | [ ] Parameter $prefetcher_uri_array is not described in comment
179 | ERROR | [ ] Doc comment for parameter $redirect_array does not match actual variable name $override
180 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
182 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
186 | ERROR | [x] Inline comments must start with a capital letter
204 | ERROR | [x] Inline comments must start with a capital letter
220 | ERROR | [x] Expected newline after closing brace
221 | ERROR | [x] Inline comments must start with a capital letter
241 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
245 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
245 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
264 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
268 | ERROR | [x] Return comment indentation must be 3 spaces, found 4 spaces
268 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 20 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\PrefetcherUriAccessControlHandler.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Access\AccessResult.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\PrefetcherUriTranslationHandler.php
----------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------
12 | WARNING | [x] There must be no blank line following an inline comment
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------

FILE: modules\prefetcher\src\Tests\LoadTest.php
-----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sunil jolapara
  • šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
  • šŸ‡ŗšŸ‡øUnited States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary for PHP_CodeSniffer issues should always show the report given from PHP_CodeSniffer and the arguments passed to phpcs.

    Furthermore, since GitLab CI is now enabled for all the projects, GitLab CI should be used to get PHP_CodeSniffer errors/warnings.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡µšŸ‡­Philippines cleavinjosh
  • šŸ‡µšŸ‡­Philippines cleavinjosh
  • Pipeline finished with Success
    12 days ago
    Total: 135s
    #336309
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @sunil jolapara,

    Thank you for providing an MR. I Applied MR!2, it was applied smoothly and fixed most of the phpcs issues.
    These are the remaining issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml:

    āžœ  prefetcher git:(8.x-1.x) curl https://git.drupalcode.org/project/prefetcher/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 50784    0 50784    0     0   104k      0 --:--:-- --:--:-- --:--:--  104k
    patching file prefetcher.drush.inc
    patching file prefetcher.install
    patching file prefetcher.links.menu.yml
    patching file prefetcher.module
    patching file src/Commands/PrefetcherCommands.php
    patching file src/Controller/CrawlController.php
    patching file src/CrawlerInterface.php
    patching file src/Entity/PrefetcherUri.php
    patching file src/Entity/PrefetcherUriInterface.php
    patching file src/Entity/PrefetcherUriType.php
    patching file src/Entity/PrefetcherUriViewsData.php
    patching file src/Form/ImportPrefetcherUrisForm.php
    patching file src/Form/ImportSitemapForm.php
    patching file src/Form/PrefetcherConfigForm.php
    patching file src/Form/PrefetcherUriForm.php
    patching file src/Form/PrefetcherUriSettingsForm.php
    patching file src/Plugin/PrefetcherCrawler/CrawlerBasic.php
    patching file src/Plugin/views/field/PrefetcherLabel.php
    patching file src/PrefetcherCrawlerManager.php
    patching file src/PrefetcherImporterService.php
    patching file src/PrefetcherUriAccessControlHandler.php
    patching file src/PrefetcherUriTranslationHandler.php
    patching file src/Tests/LoadTest.php
    āžœ  prefetcher git:(8.x-1.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml prefetcher
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/ImportPrefetcherUrisForm.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherConfigForm.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
     159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     218 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     228 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     238 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     246 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     343 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     351 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     368 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherUriForm.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
     22 | WARNING | Unused variable $entity.
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUri.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
     64 | WARNING | Possible useless method overriding detected
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriViewsData.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------
     21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriInterface.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------
     15 | WARNING | There must be no blank line following an inline comment
     23 | WARNING | There must be no blank line following an inline comment
     34 | WARNING | There must be no blank line following an inline comment
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Plugin/PrefetcherCrawler/CrawlerBasic.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
     375 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     381 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     386 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     391 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     396 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     401 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     408 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Service/Prefetcher.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
     161 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     172 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     200 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     212 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     235 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     248 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     249 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 957ms; Memory: 14MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

  • šŸ‡µšŸ‡­Philippines cleavinjosh

    cleavinjosh ā†’ changed the visibility of the branch 3476395-resolve-phpcs-issues to hidden.

  • Pipeline finished with Success
    12 days ago
    Total: 135s
    #336318
  • Pipeline finished with Success
    12 days ago
    Total: 137s
    #336331
  • Pipeline finished with Success
    12 days ago
    Total: 136s
    #336337
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi,

    Please check and advise on the issues found when running the phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml on local.

    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml prefetcher
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/ImportPrefetcherUrisForm.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------
     112 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherConfigForm.php
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
     159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     218 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     228 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     238 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     246 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     343 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     351 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     368 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Form/PrefetcherUriForm.php
    -------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------------------
     22 | WARNING | Unused variable $entity.
    -------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriViewsData.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------
     21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Entity/PrefetcherUriInterface.php
    --------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------------------
     15 | WARNING | There must be no blank line following an inline comment
     23 | WARNING | There must be no blank line following an inline comment
     34 | WARNING | There must be no blank line following an inline comment
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Plugin/PrefetcherCrawler/CrawlerBasic.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
     375 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     381 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     386 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     391 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     396 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     401 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     408 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/prefetcher/src/Service/Prefetcher.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
     161 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     172 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     200 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     212 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     223 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     235 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     248 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     249 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 913ms; Memory: 14MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

Production build 0.71.5 2024