Problem/Motivation
C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig bg_img_field
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\bg_img_field.module
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\src\Component\Render\CSSSnippet.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\src\Plugin\Field\FieldFormatter\BgImgFieldFormatter.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
38 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
165 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection instead
229 | ERROR | [x] Expected 1 space after "="; 2 found
230 | ERROR | [x] Expected 1 space after IF keyword; 0 found
239 | ERROR | [x] Expected newline after closing brace
250 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
321 | WARNING | [ ] ImageStyle::load calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\src\Plugin\Field\FieldType\BgImgItem.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | WARNING | [x] Unused use statement
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\src\Plugin\Field\FieldWidget\BgImageFieldWidget.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
45 | ERROR | [x] Inline comments must start with a capital letter
47 | ERROR | [x] Expected one space after the comma, 0 found
47 | ERROR | [x] There should be no white space before a closing ")"
86 | ERROR | [x] The first index in a multi-value array must be on a new line
87 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
179 | ERROR | [x] Missing function doc comment
184 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
185 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\src\Plugin\media\Source\BackgroundImageMedia.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
22 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\bg_img_field\templates\background-style.html.twig
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------
Time: 1.92 secs; Memory: 6MB
Steps to reproduce
Run the phpcs command on the module.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes