Fix the issues reported by phpcs

Created on 5 July 2023, 12 months ago
Updated 24 August 2023, 10 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/opencollective/opencollective.routing.yml
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | The administration page callback should probably use "administer site configuration" - which implies the user can change
| | something - rather than "access administration pages" which is about viewing but not changing configurations.
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
7 | WARNING | Line exceeds 80 characters; contains 152 characters
21 | WARNING | Line exceeds 80 characters; contains 81 characters
39 | WARNING | Line exceeds 80 characters; contains 92 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_webhooks/opencollective_webhooks.links.menu.yml
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_webhooks/src/Service/IncomingWebhooksFactory.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_webhooks/src/Service/PollingTokenManager.php
----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
30 | ERROR | Doc comment is empty
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_webhooks/src/Form/TestForm.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
27 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_webhooks/src/Entity/WebhookEventInterface.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
8 | ERROR | Doc comment is empty
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_commerce/opencollective_commerce.module
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
67 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
67 | ERROR | [x] No space found before comment text; expected "// case SetupGuidance::REQUIREMENT_INFO:" but found "//case
| | SetupGuidance::REQUIREMENT_INFO:"
67 | ERROR | [x] Inline comments must start with a capital letter
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_commerce/assets/css/status-report.css
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Additional whitespace found at start of file
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_commerce/src/Service/EventSyncManager.php
-------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
-------------------------------------------------------------------------------------------------------------
16 | ERROR | [x] Missing class doc comment
18 | ERROR | [x] Missing function doc comment
73 | ERROR | [ ] Missing short description in doc comment
74 | ERROR | [ ] If there is no return value for a function, there must not be a @return tag.
74 | ERROR | [ ] Description for the @return value is missing
161 | ERROR | [ ] Missing short description in doc comment
162 | ERROR | [ ] Missing parameter comment
164 | ERROR | [ ] If there is no return value for a function, there must not be a @return tag.
164 | ERROR | [ ] Description for the @return value is missing
197 | WARNING | [ ] Unused variable $slug.
213 | WARNING | [ ] Unused variable $slug.
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_commerce/src/PluginForm/ContributionFlowPaymentForm.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
71 | ERROR | [x] No space found before comment text; expected "// 'hideHeader' => TRUE," but found "//'hideHeader' => TRUE,"
80 | WARNING | [x] '@todo - Make this better.' should match the format '@todo Fix problem X here.'
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

FILE: .../www/html/vb/d_cont/opencollective/modules/opencollective_commerce/src/Plugin/Commerce/PaymentGateway/ContributionFlowPaymentGateway.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
37 | ERROR | Missing short description in doc comment
38 | ERROR | Missing parameter comment
40 | ERROR | Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_api/README.md
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------
10 | WARNING | Line exceeds 80 characters; contains 93 characters
---------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_api/css/api-events.css
------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------
1 | ERROR | [x] Opening brace should be the last content on the line
1 | ERROR | [ ] Class definition is empty
1 | ERROR | [x] Closing brace of class definition must be on new line
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_api/src/Service/ApiClientFactory.php
--------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------
10 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_api/src/Service/ApiClient.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/opencollective/modules/opencollective_api/src/ApiQueryPluginBase.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
23 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------------------------

Time: 1.06 secs; Memory: 18MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig opencollective/

Remaining tasks

Patch review

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @urvashi_vora
  • Hii, @urvashi_vora I have Review your patch.

    These are the steps I followed:

    1. Took clone from git version 1.0.x in drupal 10.1.x

    2. Applied patch and ran this command:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/opencollective/

    But I found errors.

    3. I have fixed that error with phpcbf.

    Ran this command to fix the errors:

    ./vendor/bin/phpcbf --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/opencollective/

    4. Then again checked with phpcs:

    ./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,m
    d,yml,twig modules/contrib/opencollective/

    Found no errors.

    Please review this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia TanujJain-TJ

    Tanuj. โ†’ made their first commit to this issueโ€™s fork.

Production build 0.69.0 2024