Fix the issues reported by phpcs

Created on 20 April 2023, over 1 year ago
Updated 10 August 2023, over 1 year ago

Problem/Motivation

Getting the following errors/warnings.

FILE: /link_description/tests/src/Functional/LinkDescriptionFieldWidgetTest.php
---------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
---------------------------------------------------------------------
 30 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Link description &'
 36 | ERROR   | [x] Expected 1 blank line after function; 0 found
 37 | ERROR   | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------


FILE: /link_description/tests/src/Functional/LinkDescriptionFieldTestBase.php
------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------
 75 | ERROR | [x] Expected 1 blank line after function; 0 found
 76 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------



FILE: /link_description/tests/src/Functional/LinkDescriptionFieldFormattersTest.php
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
 285 | ERROR | [x] Expected 1 blank line after function; 0 found
 286 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------



FILE: /link_description/src/Plugin/Field/FieldWidget/LinkDescriptionWidget.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
 34 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------


FILE: /link_description/src/Plugin/Field/FieldType/LinkDescriptionItem.php
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------
 30 | WARNING | [x] '@todo: use "text" as the type definition!!' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------

Steps to reproduce

Run the following command:

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml link_description

Proposed resolution

The above errors/warnings need to be fixed.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India omkar_yewale Mumbai

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

Production build 0.71.5 2024