Problem/Motivation

FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/lazy/js/lazy.js
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 27 | ERROR | TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
    |       |     found "true"
--------------------------------------------------------------------------------



CommentFileSizeAuthor
#2 coding_standard-3380611-2.patch434 bytesrohit rana

Issue fork lazy-3380611

Command icon 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

Rohit Rana created an issue. See original summary.

rohit rana’s picture

Assigned: rohit rana » Unassigned
Status: Active » Needs review
StatusFileSize
new434 bytes
osman’s picture

Hi Rahit,

Are you positive you're running PHPCS with `Drupal`, and `DrupalPractice` coding-standards loaded? AFAIK, JavaScript boolean values should be lowercase, but for PHP it should be uppercase.

You can check the installed standards via `phpcs -i`

Because this is what I get:

osman@drupal-web:/var/www/html$ vendor/bin/phpcs web/modules/contrib/lazy

FILE: /var/www/html/web/modules/contrib/lazy/lazy.module
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
 9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FormatterInterface.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/contrib/lazy/src/Form/LazyForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 17 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Extension\ModuleHandlerInterface.
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

Time: 203ms; Memory: 10MB

osman@drupal-web:/var/www/html$ vendor/bin/phpcs -i
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard

VladimirAus made their first commit to this issue’s fork.

vladimiraus’s picture

jannakha’s picture

Status: Needs review » Reviewed & tested by the community

all green!

osman’s picture

* Drupal 8
* PHP 7.4
* PHPCS 3.10.1 (stable)

Before:

osman@drupal8-web:/var/www/html$ ./vendor/bin/phpcs -s -p --standard=Drupal web/modules/lazy/
..E..E.... 10 / 10 (100%)



FILE: /var/www/html/web/modules/lazy/js/lazy.js
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
 27 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true" (Generic.PHP.UpperCaseConstant.Found)
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/lazy/src/Form/LazyForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 17 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Extension\ModuleHandlerInterface.
    |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

Time: 294ms; Memory: 8MB

After:

osman@drupal8-web:/var/www/html$ ./vendor/bin/phpcs -s -p --standard=Drupal web/modules/lazy/
.......... 10 / 10 (100%)


Time: 984ms; Memory: 8MB

  • osman committed 0db8569e on 8.x-3.x
    Issue #3380611 by Rohit Rana, osman: Drupal Coding Standard Issue
    
osman’s picture

Status: Reviewed & tested by the community » Fixed
vladimiraus’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.