Problem/Motivation
Running :-
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/cdt/
returns the following warnings/errors, which should be fixed.
FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/content_dependency_tracker/content_dependency_tracker.module
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------
FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/content_dependency_tracker/src/ReferenceFinder.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 4 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityFieldManagerInterface.
11 | ERROR | [x] Missing class doc comment
13 | ERROR | [ ] Missing member variable doc comment
14 | ERROR | [ ] Missing member variable doc comment
15 | ERROR | [ ] Missing member variable doc comment
23 | ERROR | [x] Missing function doc comment
38 | WARNING | [ ] Line exceeds 80 characters; contains 97 characters
48 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
66 | ERROR | [x] Missing function doc comment
67 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
73 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
86 | ERROR | [x] Expected 1 blank line after function; 0 found
87 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/content_dependency_tracker/src/Form/ContentDependencyTrackerAdminForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
9 | ERROR | [x] Missing class doc comment
41 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
48 | ERROR | [ ] The array declaration extends to column 133 (the limit is 120). The array content should be split up over multiple lines
51 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
95 | ERROR | [x] list(...) is forbidden, use [...] instead.
106 | ERROR | [x] Expected 1 blank line after function; 0 found
107 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/content_dependency_tracker/src/EventSubscriber/FormAlterSubscriber.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\content_dependency_tracker\ReferenceFinder.
14 | ERROR | [x] Missing class doc comment
17 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [ ] Missing member variable doc comment
19 | ERROR | [ ] Missing member variable doc comment
27 | ERROR | [x] Missing function doc comment
34 | ERROR | [x] Missing function doc comment
45 | WARNING | [ ] Unused variable $field_name.
79 | ERROR | [x] Expected 1 blank line after function; 0 found
80 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/content_dependency_tracker/content_dependency_tracker.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: /home/prem/Documents/drupal-10.3.1/web/modules/contrib/cdt/README.txt
-------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------
1 | WARNING | [ ] File has mixed line endings; this may cause incorrect results
1 | WARNING | [ ] File encoding is invalid, expected UTF-8
1 | ERROR | [ ] File contains UTF-16 (LE) byte order mark, which may corrupt your application
2 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------
Time: 139ms; Memory: 10MB
Steps to reproduce
Proposed resolution
Remaining tasks
Create The Mr/ Patch
User interface changes
API changes
Data model changes