Drupal coding standards

Created on 26 August 2019, over 5 years ago
Updated 18 July 2024, 10 months ago

After checking for Drupal coding standards following errors were found

FILE: C:\Users\Administrator\Sites\devdesktop\drupal8practice\modules\term_depth_condition\src\Plugin\Condition\TermDepth.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
28 | ERROR | [x] Additional blank lines found at end of doc comment
32 | ERROR | [x] Function comment short description must start with exactly one space
34 | ERROR | [x] Data types in @var tags need to be fully namespaced
41 | ERROR | [x] Data types in @param tags need to be fully namespaced
62 | ERROR | [x] Opening brace should be on the same line as the declaration
81 | ERROR | [x] Short array syntax must be used to define arrays
98 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
99 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
121 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses
164 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------------------------------------------------------------------------------------------

šŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India Rutuj

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.

  • šŸ‡®šŸ‡³India dev16.addweb

    Found one issue which I've solved in this patch

    --------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------
     80 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    --------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------
    
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @silvi.addweb,

    I applied patch#4, it was applied smoothly and fixed the phpcs issues.

    āžœ  term_depth_condition git:(8.x-1.x) curl https://www.drupal.org/files/issues/2024-05-30/3077207-4.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3424  100  3424    0     0   8412      0 --:--:-- --:--:-- --:--:--  8433
    patching file src/Plugin/Condition/TermDepth.php
    āžœ  term_depth_condition git:(8.x-1.x) āœ— ..
    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml term_depth_condition
    āžœ  contrib

    RTBC+1 for me.
    Thank you.

Production build 0.71.5 2024