Fix the issues reported by phpcs

Created on 5 April 2023, over 2 years ago

Problem/Motivation

Getting these phpcs errors and warnings.

FILE: tests/modules/cloudflare_form_tester/src/Mocks/ComposerDependenciesCheckMock.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 51 | WARNING | \Drupal calls should be avoided in classes, use dependency
    |         | injection instead
--------------------------------------------------------------------------------


FILE: tests/modules/cloudflare_form_tester/src/Mocks/ZoneMock.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 135 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
--------------------------------------------------------------------------------


FILE: /tests/src/Unit/ClientIpRestoreTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
  13 | WARNING | [x] Unused use statement
  92 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: $bypass_host
 101 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /tests/src/Functional/CloudFlareAdminSettingsFormTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 16 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /tests/src/Functional/ComposerDependencyTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 15 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /tests/src/Functional/CloudFlareAdminSettingsInvalidFormTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 18 | ERROR   | [x] Missing class doc comment
 85 | WARNING | [ ] Unused variable $mock.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /tests/src/Functional/VariousUseCasesTest.php
--------------------------------------------------------------------------------
FOUND 7 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
  12 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  17 | ERROR   | [x] Missing class doc comment
  40 | ERROR   | [x] Expected 1 blank line before function; 2 found
  59 | ERROR   | [ ] Doc comment short description must be on a single line,
     |         |     further text should be a separate paragraph
  91 | WARNING | [x] A comma should follow the last multiline array item.
     |         |     Found: ]
 114 | ERROR   | [x] Expected 1 blank line after function; 2 found
 126 | ERROR   | [x] Expected 1 blank line after function; 2 found
 132 | ERROR   | [ ] Missing parameter type
 145 | ERROR   | [ ] Missing parameter type
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: /docs/enterprise_setup.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 128 characters
  5 | WARNING | Line exceeds 80 characters; contains 197 characters
 14 | WARNING | Line exceeds 80 characters; contains 85 characters
 15 | WARNING | Line exceeds 80 characters; contains 197 characters
 16 | WARNING | Line exceeds 80 characters; contains 213 characters
----------------------------------------------------------------------


FILE: /docs/freetier_setup.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 128 characters
  5 | WARNING | Line exceeds 80 characters; contains 197 characters
 15 | WARNING | Line exceeds 80 characters; contains 85 characters
 16 | WARNING | Line exceeds 80 characters; contains 197 characters
 17 | WARNING | Line exceeds 80 characters; contains 213 characters
----------------------------------------------------------------------


FILE: /docs/disclaimers.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------
  2 | WARNING | Line exceeds 80 characters; contains 187 characters
  7 | WARNING | Line exceeds 80 characters; contains 312 characters
 15 | WARNING | Line exceeds 80 characters; contains 103 characters
----------------------------------------------------------------------


FILE: README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------
  2 | WARNING | Line exceeds 80 characters; contains 124 characters
  6 | WARNING | Line exceeds 80 characters; contains 115 characters
  9 | WARNING | Line exceeds 80 characters; contains 86 characters
 30 | WARNING | Line exceeds 80 characters; contains 117 characters
 31 | WARNING | Line exceeds 80 characters; contains 119 characters
 32 | WARNING | Line exceeds 80 characters; contains 118 characters
 36 | WARNING | Line exceeds 80 characters; contains 117 characters
 38 | WARNING | Line exceeds 80 characters; contains 118 characters
 47 | WARNING | Line exceeds 80 characters; contains 86 characters
----------------------------------------------------------------------

FILE: cloudflare.install
------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------
 51 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 54 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 63 | ERROR   | [x] Expected 1 space after CATCH keyword; 0 found
 66 | ERROR   | [x] Expected 1 space after CATCH keyword; 0 found
 69 | ERROR   | [x] Expected 1 space after CATCH keyword; 0 found
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------


FILE: /src/Form/SettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  25 | WARNING | The class short comment should describe what the class does
     |         | and not simply repeat the class name
 367 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------


FILE: /src/Form/ZoneSelectionForm.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
--------------------------------------------------------------------------------

Steps to reproduce

run this command in the cloudflare module directory phpcs --standard="Drupal,DrupalPractice" --extensions="php,module,inc,install,test,profile,theme,css,info,txt,md,yml"

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

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

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024