Fix the issues reported by phpcs

Created on 10 February 2023, about 2 years ago
Updated 9 June 2023, almost 2 years ago

Problem/Motivation

Getting the following phpcs errors/warnings:

FILE: /Documents/better_normalizers/src/Normalizer/MenuLinkContentNormalizer.php
-------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------
  67 | ERROR | [x] Short array syntax must be used to define arrays
 100 | ERROR | [x] list(...) is forbidden, use [...] instead.
 114 | ERROR | [x] Short array syntax must be used to define arrays
 157 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: /Documents/better_normalizers/src/Normalizer/FileItemNormalizer.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
 34 | ERROR | [x] Short array syntax must be used to define arrays
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------


FILE: /Documents/better_normalizers/src/Normalizer/FileEntityNormalizer.php
--------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------
 41 | ERROR | [x] Short array syntax must be used to define arrays
 46 | ERROR | [x] Short array syntax must be used to define arrays
 47 | ERROR | [x] Short array syntax must be used to define arrays
 47 | ERROR | [x] Short array syntax must be used to define arrays
 56 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------


FILE: /Documents/better_normalizers/src/Normalizer/EntityStub.php
----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------
 43 | ERROR | [x] list(...) is forbidden, use [...] instead.
----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------


FILE: /Documents/better_normalizers/src/BetterNormalizersServiceProvider.php
---------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------
 20 | ERROR | [x] Short array syntax must be used to define arrays
 30 | ERROR | [x] Short array syntax must be used to define arrays
 34 | ERROR | [x] Short array syntax must be used to define arrays
 40 | ERROR | [x] Short array syntax must be used to define arrays
 46 | ERROR | [x] Short array syntax must be used to define arrays
 58 | ERROR | [x] Short array syntax must be used to define arrays
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

Steps to reproduce

Run the following command from the module folder.

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

Proposed resolution

Fix the errors and warnings.

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India mrinalini9 New Delhi

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