Problem/Motivation
Getting following errors.
FILE: /var/www/html/modules/contrib/menu_pager/src/Plugin/Block/MenuBlock.php
-----------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
-----------------------------------------------------------------------------
108 | ERROR | [x] Use null coalesce operator instead of ternary operator.
115 | ERROR | [x] Use null coalesce operator instead of ternary operator.
122 | ERROR | [x] Use null coalesce operator instead of ternary operator.
132 | ERROR | [x] Use null coalesce operator instead of ternary operator.
146 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------
Time: 2.35 secs; Memory: 6MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/menu_pager/
Proposed resolution
Above errors need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3356373-After.png | 52.5 KB | clarkssquared |
| #3 | 3356373-Before.png | 128.03 KB | clarkssquared |
| #2 | 3356373-2.patch | 2.7 KB | samitk |
Issue fork menu_pager-3356373
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
samitk commentedAbove errors has been fixed.
Comment #3
clarkssquared commentedHi samit.310@gmail.com,
I applied your patch #2 to the "Menu Pager" module against version 3.x-dev, and verified that the PHPCS issues were resolved.
Please look at the screenshot attached for your reference.
Thank you.
Comment #7
balajidharma