Fix the issues reported by phpcs

Created on 11 October 2023, about 1 year ago
Updated 12 October 2023, about 1 year ago

Problem/Motivation

FILE: C:\wamp64\www\my_learning_site\web\modules\contrib\auto_entitylabel\auto_entitylabel.api.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] There must be no blank lines after the function comment
20 | ERROR | [ ] Invalid function name, expected m_ym_od_ul_e_entity_type_alter but found MYMODULE_entity_type_alter
24 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
33 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
45 | ERROR | [ ] Invalid function name, expected m_ym_od_ul_e_form_auto_entitylabel_settings_form_alter but found MYMODULE_form_auto_entitylabel_settings_form_alter
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: C:\wamp64\www\my_learning_site\web\modules\contrib\auto_entitylabel\auto_entitylabel.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------

FILE: C:\wamp64\www\my_learning_site\web\modules\contrib\auto_entitylabel\src\AutoEntityLabelManager.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityInterface.
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: C:\wamp64\www\my_learning_site\web\modules\contrib\auto_entitylabel\src\Plugin\Validation\EntityLabelNotNullConstraintValidator.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemList.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Install the module Automatic Entity Label and run the following command mentioned below.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml auto_entitylabel/

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia shalini_jha

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

  • Issue created by @shalini_jha
  • Assigned to viren18febS
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia viren18febS

    checking the issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    chetan 11 โ†’ made their first commit to this issueโ€™s fork.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.4 + Environment: PHP 7.3 & MySQL 8
    last update about 1 year ago
    Composer error. Unable to continue.
  • @chetan-11 opened merge request.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    Hi @shalini_jha
    I have fixed all the phpcs issues in the "Automatic Entity Label" module.
    Please check the raised MR for this & attached snapshot.

  • Issue was unassigned.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.4 + Environment: PHP 7.3 & MySQL 8
    last update about 1 year ago
    Composer error. Unable to continue.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia viren18febS

    Fixed the all issues reported by phpcs, added a patch for this.

  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi,

    I applied the patch #6 in my local and I confirmed that it fixes most of the PHPCS issues the remaining issues are "project", "datestamp", and "version" which I believe happens to occur if the module is installed via composer, hence moving this to RTBC, please refer below.

    โžœ  auto_entitylabel git:(master) โœ— curl https://www.drupal.org/files/issues/2023-10-11/fixed-issues-reported-by-phpcs-3393186%232.patch | patch -p1  
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3642  100  3642    0     0  12154      0 --:--:-- --:--:-- --:--:-- 12430
    patching file auto_entitylabel.api.php
    patching file 'src/AutoEntityLabelManager.php'
    patching file 'src/Plugin/Validation/EntityLabelNotNullConstraintValidator.php'
    โžœ  auto_entitylabel git:(master) โœ— ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml auto_entitylabel 
    
    FILE: ...d9/d9-local/web/modules/contrib/auto_entitylabel/auto_entitylabel.info.yml
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     1 | WARNING | Remove "project" from the info file, it will be added by
       |         | drupal.org packaging automatically
     1 | WARNING | Remove "datestamp" from the info file, it will be added by
       |         | drupal.org packaging automatically
     1 | WARNING | Remove "version" from the info file, it will be added by
       |         | drupal.org packaging automatically
    --------------------------------------------------------------------------------
    
    Time: 641ms; Memory: 12MB
    
    
  • Status changed to Fixed about 1 year ago
  • Status changed to Fixed about 1 year ago
Production build 0.71.5 2024