Problem/Motivation
Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml shows the following errors/warnings which should be fixed.
FILE: web/modules/contrib/braintree_api/modules/braintree_api_test/src/Form/WebhookNotificationTestForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
------------------------------------------------------------------------------------------------------------------------------------------
FILE: web/modules/contrib/braintree_api/src/Controller/BraintreeApiWebhook.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
67 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_signature") instead
67 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_payload") instead
70 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_signature") instead
70 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_payload") instead
74 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_signature") instead
74 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use $stack->getCurrentRequest()->request->get("bt_payload") instead
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: web/modules/contrib/braintree_api/src/Form/BraintreeApiAdminForm.php
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------
18 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
174 | WARNING | Only string literals should be passed to t() where possible
179 | WARNING | Only string literals should be passed to t() where possible
------------------------------------------------------------------------------------------------------------------
FILE: web/modules/contrib/braintree_api/src/BraintreeApiService.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------
Time: 92ms; Memory: 10MB
Comments
Comment #2
andrii momotov commentedComment #4
andrii momotov commentedFixed the errors/warnings reported by PHP_CodeSniffer.
Please review. Thanks!
Comment #5
silvi.addweb commentedHi, I have tested MR and found below issue
Comment #6
silvi.addweb commentedComment #7
vinmayiswamy commentedHi @silvi.addweb, thanks for the MR.
I've tested MR !4 on Drupal 10.2.x
The MR is applied Cleanly...
Test Result:
The phpcs issues were fixed after the updated changes.
RTBC+1
Comment #8
riddhi.addweb commentedThe mentioned phpcs issue is resolved, & I have also checked and it is working as expected. I am attaching the Screenshots & doing RTBC for the same.
Comment #12
shaundychkoThank you all for your help.