Fix the issues reported by phpcs

Created on 3 July 2023, over 1 year ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

FILE: /home/system/Documents/contribution/informea_api-3371902/README.md
------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------
  98 | WARNING | Line exceeds 80 characters; contains 104 characters
 100 | WARNING | Line exceeds 80 characters; contains 113 characters
------------------------------------------------------------------------

Time: 161ms; Memory: 8MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig informea_api/

Remaining tasks

Fix remaining issues.

๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @urvashi_vora,

    I reviewed the changes and confirmed the Patch was applied cleanly.

    Checking patch README.md...
    Checking patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php...
    Applied patch README.md cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php cleanly.

    However, I'm still seeing a couple of phpcs errors:

    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/informea_api/README.md
    --------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------
      98 | WARNING | Line exceeds 80 characters; contains 104 characters
     100 | WARNING | Line exceeds 80 characters; contains 110 characters
    --------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/informea_api/src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------------------
     48 | ERROR | [x] Use null coalesce operator instead of ternary operator.
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 513ms; Memory: 10MB

    Moving this to Needs work.

    Thank you.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev
      98 | WARNING | Line exceeds 80 characters; contains 104 characters
     100 | WARNING | Line exceeds 80 characters; contains 110 characters 

    These two are commands so that needs to be in same line for a better understanding.
    Updated the 3rd issue.
    Please review.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

    Marking it to Needs Review, so that the patch could be reviewed.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @sakthi_dev

    I applied your Patch and confirmed it resolves the other PHPCS errors.

    Checking patch README.md...
    Checking patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php...
    Applied patch README.md cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php cleanly.

    However, the errors regarding the "line exceeds" still exist.

    Please see the attached file for your reference.

    Moving this again to "Needs work".
    Thank you!

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Please review.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi @sakthi_dev,

    Confirmed your Patch was applied cleanly.

    Checking patch README.md...
    Checking patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php...
    Applied patch README.md cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php cleanly.

    However, I'm seeing new PHPCS errors, and the errors for the "line exceeds" have been fixed already.

    FILE: /Users/roberttabigue/Projects/drupalorgissues/docroot/modules/contrib/informea_api/src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
     58 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
     59 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 493ms; Memory: 10MB

    Assigning to Needs work for the investigation.
    Thank you!

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mrinalini9 New Delhi

    Updated patch #6 by addressing #7, please review it.

    Thanks!

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    fields to the view, use the serializable versions of the fields(e.g. Title
    +(serializable)).

    There is a missing space before the parenthesis.

       /**
    +   * Get the legislation relations.

    The verb must be declined in the third person singular.

           '@use_keys' => $this->getSetting('use_keys')
    -        ? $this->t('Yes')
    -        : $this->t('No'),
    +      ? $this->t('Yes')
    +      : $this->t('No'),
    

    The code is already correctly indented.

    -   * @return boolean
    +   * @return bool
        *   Yes if the string field value is yes.
    

    Since that comment is changed, the return value description must be changed too: The Boolean values are TRUE and FALSE. That method cannot return Yes, which is not a constant PHP uses for Boolean values.

    -    $value = isset($mapping[$field_value]) ? $mapping[$field_value] : NULL;
    +    $value = isset($mapping[$field_value]) ?? NULL;
    

    If the null coalescing operator is used, isset() is not used.

  • Assigned to imustakim
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad
  • Merge request !23371902-phpcs-fixes โ†’ (Open) created by imustakim
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    I faced some issue while creating the merge request.
    So Updating the patch, please review. Address all the issue mentioned in #9 ๐Ÿ“Œ Fix the issues reported by phpcs Needs review .

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines roberttabigue

    Hi,

    I reviewed the changes made in #12 to address the issues mentioned in #9, and confirmed that Patch #12 was applied cleanly to the module.

    Checking patch README.md...
    Checking patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php...
    Checking patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php...
    Applied patch README.md cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/InformeaCountryIso3Formatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LegislationRelationsFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/LinkWithTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MeetingStatusFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/MultipleValueListTextFormatter.php cleanly.
    Applied patch src/Plugin/Field/FieldFormatter/StringToBooleanFormatter.php cleanly.

    And no PHPCS errors have been detected.

    Please see the attached file for reference.

    I'm moving this now to RTBC.

    Thank you!

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Can't show this merge request because the target branch 1.0.0-alpha1 is missing from project issue/informea_api-3371902. Close this merge request or update the target branch.

    1.0.0-alpha1 is not a branch.

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

  • First commit to issue fork.
  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Updated IS with the remaining issues.

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Updating IS for the remaining issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Please review. Thanks.

  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    apaderno โ†’ changed the visibility of the branch 3371902- to hidden.

  • Pipeline finished with Success
    6 months ago
    Total: 139s
    #191925
  • Status changed to RTBC 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
Production build 0.71.5 2024