Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml shows the following warnings/errors which should be fixed.
FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\preview_site\src\Deploy\DeployPluginBase.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
60 | ERROR | The trigger_error message 'The method \Drupal\preview_site\Deploy\DeployPluginInterface::deployFilePath is deprecated in Deploy plugins. It should be
| | implemented.' does not match the relaxed standard format: %thing% is deprecated in %deprecation-version% any free text %removal-version%. %extra-info%. See
| | %cr-link%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\preview_site\src\Generate\TomeStaticExtension.php
----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
102 | WARNING | Possible useless method overriding detected
----------------------------------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\preview_site\src\PreviewSiteBuilder.php
------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
76 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\projects\drupal\web\modules\preview_site\tests\src\Kernel\TomeGeneratorEntityEmbedTest.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations.
-------------------------------------------------------------------------------------------------------------------------------------------------
Time: 1.76 secs; Memory: 14MB
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | previewsite_patch30.png | 42.95 KB | roberttabigue |
| #30 | 3293092-30.patch | 11.86 KB | chaitanyadessai |
| #26 | phpcs_fix.patch | 4.86 KB | Shreyas gowda |
| #12 | interdiff_9-12.txt | 2.66 KB | hardikpandya |
| #12 | 3293092-12.patch | 11.9 KB | hardikpandya |
Issue fork preview_site-3293092
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
rakhi soni commentedI have created a patch to fix the issue of "Drupal Coding Standard",, please review.
Thanks & Regards
Rakhi Soni,,
Comment #4
urvashi_vora commentedHi, I am working on this.
Comment #5
urvashi_vora commentedHi,
Please review this patch.
Thanks
Comment #7
larowlanCouple of test fails here, thanks
Comment #8
rakhi soni commentedI have tried to fix this drupal coding standard issue once again ,, kindly review patch.
Comment #9
nayana_mvr commentedI have fixed the Drupal coding standard issue except the following
I don't know how to fix the above error. If someone can guide me on this, I'll fix that also.
Comment #10
sahil.goyal commentedHi @nayana_mvr you can just give the one line comment to the variables, i'll just be fine then.
Comment #11
larowlanIgnore those, the properties are private and type hinted - docs are not needed
Comment #12
hardikpandya commentedI have fixed a few more phpcs issues. Attached is the interdiff.
I still see the below issue reported which I am not sure of how to fix.
Comment #13
avpadernoComment #14
mstrelan commentedNow that #3391807: Use Gitlab CI is in can we get an MR instead of patches and ensure the phpcs job comes back green?
Comment #18
urvashi_vora commentedComment #19
avpadernoComment #20
avpadernoIf I run PHP_CodeSniffer for the 1.x branch, I get more warnings/errors than the issue summary shows.
Comment #24
ankithashettyComment #25
zkhan.aamir commentedHi,
MR #23 applied cleanly.
Remaining errors
Comment #26
Shreyas gowda commentedfixed all the phpcs issues one error and warning is left
FILE: C:\wamp64\www\contribution\preview_site\src\Deploy\DeployPluginBase.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
60 | ERROR | The trigger_error message 'The method
| | \Drupal\preview_site\Deploy\DeployPluginInterface::deployFilePath
| | is deprecated in Deploy plugins. It should be implemented.' does
| | not match the relaxed standard format: %thing% is deprecated in
| | %deprecation-version% any free text %removal-version%.
| | %extra-info%. See %cr-link%
--------------------------------------------------------------------------------
FILE: ...\wamp64\www\contribution\preview_site\src\Generate\TomeStaticExtension.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
102 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------
Comment #27
shruu_rao commentedHi,
Applied #26 patch, the patch does not apply cleanly and throws error.
Comment #28
zkhan.aamir commentedHi,
Patch #26 applied successfully.
Still issue remaining.
Comment #29
zkhan.aamir commentedIssue summary updated.
Comment #30
chaitanyadessai commentedFixed remaining issues.
Comment #31
roberttabigue commentedHi guys!
I have reviewed the changes and confirmed that Patch #30 was applied cleanly to the Preview Site module against 1.x-dev on Drupal 10.
And all PHPCS errors have been fixed.
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml preview_sitePlease see the attached file for reference.
I'm moving this now to ‘RTBC’.
Thank you!