Fix the issues reported by phpcs

Created on 21 December 2022, about 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/coffee/js/coffee.js
----------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 10 LINES
----------------------------------------------------------------------
73 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
95 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
99 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
104 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
133 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
136 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
163 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
171 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
190 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
200 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/coffee/src/Controller/CoffeeController.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
64 | ERROR | [ ] Parameter $url_generator is not described in
| | comment
64 | ERROR | [ ] Parameter $route_match is not described in
| | comment
135 | ERROR | [x] Expected newline after closing brace
135 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
212 | WARNING | [x] Inline @var declarations should use the /** */
| | delimiters
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/coffee/src/Form/CoffeeConfigurationForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
79 | WARNING | Menu::loadMultiple calls should be avoided in
| | classes, use dependency injection instead
----------------------------------------------------------------------

FILE: ...ests/modules/coffee_test/src/Controller/CoffeeTestController.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
8 | ERROR | [x] Missing class doc comment
10 | ERROR | [x] Missing function doc comment
12 | ERROR | [x] Expected 1 blank line after function; 0 found
13 | ERROR | [x] The closing brace for the class must have an empty
| | line before it
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /app/modules/contrib/coffee/tests/src/Functional/CoffeeTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
79 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
80 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------

FILE: ...p/modules/contrib/coffee/tests/src/Kernel/CoffeeCommandsTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
65 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
71 | WARNING | t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait
| | and $this->t() instead
----------------------------------------------------------------------

Time: 937ms; 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/coffee/

Proposed resolution

Run phpcbf for auto fixable issues, and do manual fixes.
Above error/warnings need to be fixed.

Remaining tasks

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia shivam-kumar

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