Fix the issues reported by phpcs

Created on 13 April 2023, over 1 year ago
Updated 27 April 2023, over 1 year ago

Running phpcs --colors --standard=./phpcs.xml --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig for this module returns the following report.

FILE: ./includes/display_fields.field_ui.inc
 56 | ERROR | [x] Data types in @param tags need to be fully namespaced

FILE: ./src/AllTokens.php
   3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  15 | ERROR | [x] Whitespace found at end of line
  54 | ERROR | [x] Separate the @param and @return sections by a blank line.
  56 | ERROR | [x] Short array syntax must be used to define arrays
  56 | ERROR | [x] Expected 1 space before opening brace; found 0
  73 | ERROR | [x] Short array syntax must be used to define arrays
  75 | ERROR | [x] Short array syntax must be used to define arrays
  80 | ERROR | [x] Short array syntax must be used to define arrays
 100 | ERROR | [x] Separate the @param and @return sections by a blank line.
 102 | ERROR | [x] Short array syntax must be used to define arrays
 107 | ERROR | [x] Short array syntax must be used to define arrays
 124 | ERROR | [x] Separate the @param and @return sections by a blank line.
 126 | ERROR | [x] Short array syntax must be used to define arrays

FILE: ./src/DisplayFieldsViewListBuilder.php
 17 | ERROR | [x] No space found before comment text; expected "// $header['label'] = $this->t('Label');" but found
    |       |     "//$header['label'] = $this->t('Label');"
 28 | ERROR | [x] No space found before comment text; expected "// $row['label'] = $entity->label();" but found "//$row['label'] =
    |       |     $entity->label();"

Those lines must be fixed.

As a side note, the phpcs.xml file used by this project is a copy of the phpcs.xml file used by Drupal core.
It does not report all the issues reported using the Drupal or DrupalPractice standards, but that is intentional.

📌 Task
Status

Fixed

Version

9.1

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024