Drupal Coding Standards Issues | phpcs

Created on 27 December 2022, about 2 years ago
Updated 3 June 2024, 7 months ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/block_access/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
2 | WARNING | Line exceeds 80 characters; contains 136 characters
11 | WARNING | Line exceeds 80 characters; contains 103 characters
----------------------------------------------------------------------

FILE: /app/modules/contrib/block_access/block_access.module
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
26 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 6
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------

FILE: /app/modules/contrib/block_access/src/Access/CreateBlockContentTypeCheck.php
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------------
33 | WARNING | [x] A comma should follow the last multiline array item. Found: )
37 | ERROR | [x] Expected 1 blank line after function; 0 found
38 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: /app/modules/contrib/block_access/src/Routing/RouteSubscriber.php
-----------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
31 | ERROR | [x] Expected 1 blank line after function; 0 found
32 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

Time: 1.25 secs; Memory: 10MB

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/block_access/

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ› Bug report
Status

RTBC

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !6resolve phpcs issues โ†’ (Open) created by Unnamed author
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    Applied patch and found 1 issue.

    FILE: /home/addweb/Drupal8-vagrant/web/web/block_access-3329767/block_access.module
    ----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------
     11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\RevisionLogInterface.
    ----------------------------------------------------------------------------------------------------------------------------------
    

    Resolve this and created MR including #3 patch changes.

  • Status changed to RTBC 7 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mitthukumawat

    The coding standard issues stand fixed. Checkout to the issue and phpcs looks clean now. Moving to RTBC.

Production build 0.71.5 2024