Problem/Motivation
Found coding standard issues.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml site_guardian
FILE: /Users/projects/drupal-d10/modules/contrib/site_guardian/tests/src/Unit/SiteGuardianServiceUnitTest.php
------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------
10 | WARNING | Line exceeds 80 characters; contains 96 characters
10 | WARNING | There must be no blank line following an inline comment
101 | WARNING | Unused variable $projects.
------------------------------------------------------------------------------------------
FILE: /Users/projects/drupal-d10/modules/contrib/site_guardian/src/Controller/SiteGuardianController.php
------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------
63 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
65 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
76 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
103 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
105 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
115 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------
FILE: /Users/projects/drupal-d10/modules/contrib/site_guardian/src/Services/SiteGuardianService.php
------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------
60 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
67 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
93 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
99 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
100 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
131 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
136 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
147 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
154 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
182 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
190 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------
Time: 144ms; Memory: 10MB
Steps to reproduce
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml site_guardian
Proposed resolution
Fix the coding errors
Remaining tasks
Fix the coding errors and commit the fixes
User interface changes
None
API changes
None
Data model changes
None
Issue fork site_guardian-3358426
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
arpitk commentedWorking on this
Comment #4
arpitk commentedWorked on the major coding standard issues. Created a MR. Please review.
Thanks!
Comment #5
the_g_bomb commentedThanks @arpitk for the work so far, I have merged the latest changes in and added a change or two myself.
https://simplytest.me/project/site_guardian/1.0.x?patch[]=https://git.dr...
It seems the auto addition of patches isn't working on simplytest.me so you can follow the above link, but then add the patch back into the build using: https://git.drupalcode.org/project/site_guardian/-/merge_requests/2.diff
Comment #6
avpadernoComment #7
seeduardo commentedCode reviewed, spun up again on simplytest.me and then phpcs run on fork again, with success, thanks @the_g_bomb!
Comment #9
seeduardo commentedMinor changes also checked, thanks @i-trokhanenko! Merging....
Comment #11
seeduardo commented