Fix the issues reported by PHPCS

Created on 9 March 2023, over 1 year ago

Problem/Motivation

Getting the following error/warnings

FILE: /drupal_slider/templates/drupal_slider_views.theme.inc
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
34 | ERROR | [x] Whitespace found at end of line
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideGroupEditForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------
9 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
39 | ERROR | [x] Use null coalesce operator instead of ternary operator.
48 | ERROR | [x] Use null coalesce operator instead of ternary operator.
56 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideGroupDeleteForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideBaseForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
178 | ERROR | The array declaration extends to column 124 (the limit is 80). The array content should be split up over multiple lines
183 | ERROR | The array declaration extends to column 122 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideGroupAddForm.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideGroupBaseForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
14 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
202 | ERROR | The array declaration extends to column 135 (the limit is 80). The array content should be split up over multiple lines
207 | ERROR | The array declaration extends to column 133 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideEditForm.php
------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
------------------------------------------------------------------------------------------
37 | ERROR | [x] Use null coalesce operator instead of ternary operator.
52 | ERROR | [x] Use null coalesce operator instead of ternary operator.
58 | ERROR | [x] Use null coalesce operator instead of ternary operator.
64 | ERROR | [x] Use null coalesce operator instead of ternary operator.
70 | ERROR | [x] Use null coalesce operator instead of ternary operator.
103 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Form/SlideDeleteForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Plugin/views/style/DrupalSlider.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------
152 | WARNING | #options values usually have to run through t() for translation
154 | WARNING | #options values usually have to run through t() for translation
155 | WARNING | #options values usually have to run through t() for translation
-------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Plugin/views/field/DrupalSliderViewsField.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
109 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /drupal_slider/src/Plugin/views/field/DrupalSliderThumbnails.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
78 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the following command:
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml drupal_slider

📌 Task
Status

RTBC

Version

2.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