Fix the issues reported by phpcs

Created on 6 February 2023, almost 2 years ago
Updated 11 July 2024, 5 months ago
๐Ÿ“Œ Task
Status

RTBC

Version

5.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sahil.goyal

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

Merge Requests

Comments & Activities

  • Issue created by @sahil.goyal
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sahil.goyal

    Fixing all the php coding standard issues and warnings in this patch. Please Review.

  • Assigned to Charchil Khandelwal
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    I will review this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Patch #2 tested and applied successfully, all errors and warnings are fixed now.
    Created MR !9 for this issue.
    Please review.

    Thanks.

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
     /**
      * @file
    - * Describes hooks and plugins provided by the Corresponding entities references module.
    + * Corresponding entities module offers hooks & plugins for references.
      */

    The correct short description for those files is Describes hooks provided by the [module name] module.

    - *   Differences arrary calculated by CorrespondingReference::calculateDifferences()
    + *   Diff. arrary calculated by CorrespondingReference::calculateDifferences()

    The existing description is correct, except for a typo.

    function hook_cer_differences_alter(\Drupal\Core\Entity\ContentEntityInterface $entity,
    -  array &$differences, $correspondingField) {
    +  array &$differences,
    + $correspondingField) {

    As per Drupal coding standards, function declarations are written in a single line.

    +  /**
    +   * Builds the header row for the entity listing.
    +   */
       public function buildHeader() {

    The return value is not documented.

    +  /**
    +   * Builds the row for the entity listing.
    +   */
       public function buildRow(EntityInterface $entity) {

    Parameters and return value descriptions are missing.

  • bindu r โ†’ made their first commit to this issueโ€™s fork.

  • First commit to issue fork.
  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    2 pass
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Addressed the comment #7. Please review.

  • Status changed to Needs work 5 months ago
  • Hi @sakthi_dev,

    Your changes on the MR !9 was applied not-so successfully and errors were reported. Please see below:

     cer git:(5.x) curl https://git.drupalcode.org/project/cer/-/merge_requests/9.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 21604    0 21604    0     0  45057      0 --:--:-- --:--:-- --:--:-- 46560
    patching file README.md
    patching file cer.api.php
    patching file cer.module
    patching file src/CorrespondingReferenceListBuilder.php
    patching file src/CorrespondingReferenceOperations.php
    patching file src/CorrespondingReferenceStorage.php
    patching file src/CorrespondingReferenceStorageInterface.php
    patching file src/Entity/CorrespondingReference.php
    patching file src/Entity/CorrespondingReferenceInterface.php
    patching file src/EventSubscriber/CerSubscriber.php
    patching file src/Form/CorrespondingReferenceDeleteForm.php
    patching file src/Form/CorrespondingReferenceForm.php
    Hunk #7 succeeded at 186 (offset 1 line).
    Hunk #8 succeeded at 206 (offset 1 line).
    Hunk #9 succeeded at 245 (offset 1 line).
    Hunk #10 succeeded at 268 (offset 1 line).
    Hunk #11 succeeded at 279 (offset 1 line).
    Hunk #12 succeeded at 306 (offset 1 line).
    Hunk #13 succeeded at 315 (offset 1 line).
    patching file src/Form/CorrespondingReferenceSyncForm.php
    โžœ  cer git:(5.x) โœ— cd ..
    โžœ  contrib git:(master) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig cer
    
    FILE: ...etInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/cer/cer.api.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     14 | WARNING | Line exceeds 80 characters; contains 83 characters
    --------------------------------------------------------------------------------
    
    
    FILE: ...-orgissue-v9/web/modules/contrib/cer/src/Entity/CorrespondingReference.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\cer\CorrespondingReferenceOperations.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    
    FILE: ...issue-v9/web/modules/contrib/cer/src/CorrespondingReferenceListBuilder.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is
       |       |     Drupal\cer\Entity\CorrespondingReferenceInterface.
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    Time: 545ms; Memory: 12MB

    Kindly check

    Thanks,
    Jake

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    apaderno โ†’ changed the visibility of the branch 3339496-drupal-coding-standards to hidden.

  • Pipeline finished with Success
    5 months ago
    Total: 185s
    #221626
  • Pipeline finished with Success
    5 months ago
    Total: 190s
    #221628
  • Pipeline finished with Success
    5 months ago
    Total: 162s
    #221629
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to RTBC 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
Production build 0.71.5 2024