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.