Fix the issues reported by PHPCS

Created on 17 April 2023, about 1 year ago
Updated 14 May 2023, about 1 year ago

Problem/Motivation

FILE: ...contribution/drupal10/web/modules/contrib/student_uic/student_uic.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
7 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
--------------------------------------------------------------------------------

FILE: ...ibution/drupal10/web/modules/contrib/student_uic/student_uic.libraries.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...student_uic/src/Plugin/Field/FieldFormatter/StudentUICDefaultFormatter.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AND 4 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------
23 | ERROR | [ ] Missing member variable doc comment
24 | ERROR | [ ] Missing member variable doc comment
43 | ERROR | [ ] Doc comment for parameter $entity_type_manager does not
| | match actual variable name
49 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
51 | ERROR | [x] Whitespace found at end of line
75 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 1
89 | WARNING | [ ] Avoid backslash escaping in translatable strings when
| | possible, use "" quotes instead
98 | ERROR | [x] Concat operator must be surrounded by a single space
98 | ERROR | [x] Concat operator must be surrounded by a single space
101 | ERROR | [x] Concat operator must be surrounded by a single space
101 | ERROR | [x] Concat operator must be surrounded by a single space
104 | WARNING | [ ] #description values usually have to run through t() for
| | translation
125 | ERROR | [x] Whitespace found at end of line
150 | ERROR | [x] Expected one space after the comma, 0 found
150 | ERROR | [x] Expected one space after the comma, 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../modules/contrib/student_uic/src/Plugin/Field/FieldType/StudentUICItem.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 6 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
81 | ERROR | [x] Expected one space after the comma, 0 found
96 | WARNING | [ ] #options values usually have to run through t() for
| | translation
97 | WARNING | [ ] #options values usually have to run through t() for
| | translation
98 | WARNING | [ ] #options values usually have to run through t() for
| | translation
127 | WARNING | [ ] Unused variable $k.
173 | ERROR | [x] Expected 1 blank line after function; 0 found
174 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ules/contrib/student_uic/src/Plugin/Field/FieldWidget/StudentUICWidget.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
33 | ERROR | [x] Expected one space after the comma, 0 found
33 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
45 | ERROR | [x] Missing function doc comment
47 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
54 | ERROR | [x] Expected one space after the comma, 0 found
54 | ERROR | [x] Expected one space after the comma, 0 found
54 | ERROR | [ ] The array declaration extends to column 204 (the limit is
| | 80). The array content should be split up over multiple
| | lines
54 | ERROR | [x] Expected 1 space between comma and "'%length'"; 0 found
54 | ERROR | [x] Expected one space after the comma, 0 found
60 | ERROR | [x] Expected one space after the comma, 0 found
60 | ERROR | [x] Expected one space after the comma, 0 found
66 | ERROR | [x] Expected one space after the comma, 0 found
66 | ERROR | [x] Expected one space after the comma, 0 found
71 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [x] Expected one space after the comma, 0 found
72 | ERROR | [ ] The array declaration extends to column 243 (the limit is
| | 80). The array content should be split up over multiple
| | lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...pal10/web/modules/contrib/student_uic/config/schema/student_uic.schema.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
35 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 458ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix all the issues for Drupal and DrupalPractice coding standards

Remaining tasks

Patch review and fix remaining issues:
FILE: ...student_uic/src/Plugin/Field/FieldFormatter/StudentUICDefaultFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
60 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: .../modules/contrib/student_uic/src/Plugin/Field/FieldType/StudentUICItem.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
125 | WARNING | Unused variable $v.
--------------------------------------------------------------------------------

Time: 461ms; Memory: 10MB

📌 Task
Status

Fixed

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

Not all content is available!

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

Production build 0.69.0 2024