Fix the issues reported by phpcs

Created on 19 December 2022, almost 2 years ago
Updated 16 July 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Create.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Dimension.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------
9 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
28 | WARNING | [x] 'TODO remove this cast in favour of typing in PHP7.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Event.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Exception.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Group.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/GroupInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Linker/AutoLink.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Metric.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
28 | WARNING | [x] 'TODO remove this cast in favour of typing in PHP7.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Pageview.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Send.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
12 | ERROR | Missing member variable doc comment
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Set.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/AnalyticsCommand/Timing.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/CommandRegistryService.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
32 | ERROR | The text '@deprecated Use addCommand() instead.' does not match the standard format: @deprecated in %deprecation-version% and is removed from
| | %removal-version%. %extra-info%.
32 | ERROR | Each @deprecated tag must have a @see tag immediately following it
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/Event/CollectEvent.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: /app/modules/contrib/ga/src/EventSubscriber/DefaultCommandSubscriber.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
20 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/src/Form/AdminSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------
232 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
234 | ERROR | The array declaration extends to column 122 (the limit is 80). The array content should be split up over multiple lines
237 | ERROR | The array declaration extends to column 103 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/tests/src/Unit/AnalyticsCommand/EventTest.php
---------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
---------------------------------------------------------------------------
87 | ERROR | [x] Additional blank lines found at end of doc comment
91 | WARNING | [ ] Unused variable $command.
98 | ERROR | [x] Additional blank lines found at end of doc comment
102 | WARNING | [ ] Unused variable $command.
109 | ERROR | [x] Additional blank lines found at end of doc comment
113 | WARNING | [ ] Unused variable $command.
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/tests/src/Unit/AnalyticsCommand/SendTest.php
--------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------
36 | ERROR | [x] Additional blank lines found at end of doc comment
40 | WARNING | [ ] Unused variable $command.
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: /app/modules/contrib/ga/tests/src/Unit/EventSubscriber/CspSubscriberTest.php
-------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------
105 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
130 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------

Time: 2.92 secs; Memory: 12MB

Steps to reproduce

Run following command

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/ga/

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ“Œ Task
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024