Fix the issues reported by phpcs

Created on 25 April 2023, over 1 year ago
Updated 1 October 2023, about 1 year ago

Problem/Motivation

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

FILE: ...tion/drupal/web/modules/contrib/react_views/src/Form/SetViewsForReact.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
6 | ERROR | [ ] Doc comment short description must end with a full stop
6 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
12 | ERROR | [x] There must be one blank line after the namespace
| | declaration
17 | ERROR | [x] Missing class doc comment
41 | ERROR | [x] There should be no white space after an opening "("
41 | ERROR | [x] PHP keywords must be lowercase; expected "as" but found
| | "As"
41 | ERROR | [x] There should be no white space before a closing ")"
41 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
42 | ERROR | [x] Concat operator must be surrounded by a single space
42 | ERROR | [x] Concat operator must be surrounded by a single space
42 | ERROR | [x] Concat operator must be surrounded by a single space
49 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | $views
61 | WARNING | [ ] Unused variable $key.
62 | ERROR | [x] Expected 1 space after IF keyword; 0 found
62 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
67 | ERROR | [x] There should be no white space before a closing ")"
70 | ERROR | [x] Expected 1 newline at end of file; 0 found
70 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ntribution/drupal/web/modules/contrib/react_views/react_views.routing.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
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.
9 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../contribution/drupal/web/modules/contrib/react_views/react_views.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | "core_version_requirement" property is missing in the info.yml
| | file
--------------------------------------------------------------------------------

Time: 427ms; 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 react_views/

Proposed resolution

Fix all the issues

Remaining tasks

Patch Review.

📌 Task
Status

RTBC

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
  • Status changed to RTBC about 1 year ago
  • Hello, @urvashi_vora thanks for the patch

    These are the steps I followed:

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

    2. Ran this command:

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

    3. Applied your patch and, again ran phpcs command

    found no errors.

    Moving RTBC

Production build 0.71.5 2024