Drupal Coding Standard is not matched

Created on 22 April 2024, 5 months ago
Updated 24 July 2024, 2 months ago

Problem/Motivation

FILE: pager_for_node\pagerfornode.module
-------------------------------------------------------------------------------------------------------
FOUND 19 ERRORS AND 5 WARNINGS AFFECTING 24 LINES
-------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityInterface.
78 | ERROR | [x] Use null coalesce operator instead of ternary operator.
84 | ERROR | [x] Use null coalesce operator instead of ternary operator.
95 | ERROR | [x] Use null coalesce operator instead of ternary operator.
109 | ERROR | [x] Use null coalesce operator instead of ternary operator.
122 | ERROR | [x] Use null coalesce operator instead of ternary operator.
152 | ERROR | [x] Use null coalesce operator instead of ternary operator.
165 | ERROR | [x] Use null coalesce operator instead of ternary operator.
180 | ERROR | [x] Use null coalesce operator instead of ternary operator.
192 | ERROR | [x] Use null coalesce operator instead of ternary operator.
203 | ERROR | [x] Use null coalesce operator instead of ternary operator.
215 | ERROR | [x] Use null coalesce operator instead of ternary operator.
228 | ERROR | [x] Use null coalesce operator instead of ternary operator.
241 | ERROR | [x] Use null coalesce operator instead of ternary operator.
254 | ERROR | [x] Use null coalesce operator instead of ternary operator.
261 | ERROR | [x] Use null coalesce operator instead of ternary operator.
296 | ERROR | [x] Use null coalesce operator instead of ternary operator.
309 | ERROR | [x] Use null coalesce operator instead of ternary operator.
391 | ERROR | [x] Expected 1 space before "=>"; 0 found
439 | WARNING | [ ] Only string literals should be passed to t() where possible
440 | WARNING | [ ] Only string literals should be passed to t() where possible
441 | WARNING | [ ] Only string literals should be passed to t() where possible
442 | WARNING | [ ] Only string literals should be passed to t() where possible
443 | WARNING | [ ] Only string literals should be passed to t() where possible
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------

FILE: pager_for_node\README.txt
----------------------------------------------------------------------------------
FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
4 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
10 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
13 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
20 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
29 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
50 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
57 | ERROR | [x] Expected 1 newline at end of file; 3 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: pager_for_node\src\PagerForNodeEvent.php
---------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\node\NodeInterface.
13 | ERROR | [ ] Missing member variable doc comment
14 | ERROR | [ ] Missing member variable doc comment
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: pager_for_node\src\PagerForNodePager.php
---------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------
14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Utility\Token.
15 | WARNING | [x] Unused use statement
109 | ERROR | [ ] Public method name "PagerForNodePager::pagerfornode_build_list" is not in lowerCamel format
370 | WARNING | [x] 'TODO: orderRandom is not available in entityQuery yet.' should match the format '@todo Fix problem X here.'
404 | ERROR | [ ] Public method name "PagerForNodePager::pagerfornode_use_pager" is not in lowerCamel format
423 | ERROR | [ ] Public method name "PagerForNodePager::pagerfornode_generate_link" is not in lowerCamel format
436 | WARNING | [ ] Line exceeds 80 characters; contains 101 characters
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------

FILE: pager_for_node\src\Plugin\Block\PagerForNodeBlock.php
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface.
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

Steps to reproduce

Run phpcs command to get the drupal coding standard issues

Proposed resolution

Many of them will fix by running phpcbf command and rest we need to manually fix & then commit these changes & push it

๐Ÿ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia aadeshvermaster@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024