Fix the issues reported by phpcs

Created on 29 October 2022, about 2 years ago
Updated 13 July 2024, 5 months ago

Problem/Motivation

FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/smart_title/modules/smart_title_ui/src/Form/SmartTitleConfigForm.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------
  20 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 170 | ERROR   | [x] list(...) is forbidden, use [...] instead.
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_cms/drupal9/web/modules/contrib/smart_title/src/EntityViewDisplayAlterer.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 209 | ERROR | [x] Use null coalesce operator instead of ternary operator.
 211 | ERROR | [ ] The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
 216 | ERROR | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------

Time: 310ms; Memory: 12MB

Steps to reproduce

Run following command
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info smart_title

Proposed resolution

The above error needs to be fixed.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Rohit Rana

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Hi, @rohit Patch applied but still getting these issues.

    FILE: /smart_title/smart_title.module
    --------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR
    --------------------------------------------------------------------------------------------------------------------------------
    78 | ERROR | [x] list(...) is forbidden, use [...] instead.
    ---------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------

    FILE: /smart_title/smart_title.install
    ---------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------
    32 | ERROR | [x] list(...) is forbidden, use [...] instead.
    ---------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Please review the !1 MR for all of the issues listed above and those that remain.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
     /**
    - * SmartTitleConfigForm.
    + * Configure smart title settings.
      */

    The verb needs to use the Simple Present tense and the third person singular.

    -  // @TODO: (add alter || convert to config) && validate.
    +  // @todo (add alter || convert to config) && validate.

    That needs to be changed in a sentence too.

      * @return string[][]|string[]|string
      *   An array of smart title default setting values or the value of the
      *   specificed option.
    - *
    - * @TODO
      */

    That is probably a call for the maintainers, since they know if the code of that method is complete or there is something that needs to be changed or added.

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Thank you for your feedback, MR and issue description updated.
    Please review.

    I'm skipping this issue for now.
    /smart_title/smart_title.module
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
    222 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
    --------------------------------------------------------------------------------

  • 🇮🇳India Ashutosh Ahirwal India

    Providing Patch with fixes of Drupal, DrupalPractice
    Thanku

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The last patch is not correct, as it does not fix what reported in previous comments. The MR is correct, for what I can see.

  • Status changed to RTBC over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The status change is for what committed in the MR.

  • 🇭🇺Hungary huzooka Hungary 🇭🇺🇪🇺
  • Assigned to huzooka
  • Status changed to Needs work 5 months ago
  • 🇭🇺Hungary huzooka Hungary 🇭🇺🇪🇺

    I hope you don't mind if I also fix the spelling issues here.

  • Status changed to Needs review 5 months ago
  • 🇭🇺Hungary huzooka Hungary 🇭🇺🇪🇺

    Let's see what the CI process says... Should be all green.

  • Pipeline finished with Skipped
    5 months ago
    #211354
  • 🇭🇺Hungary huzooka Hungary 🇭🇺🇪🇺

    Thank you all!

  • Issue was unassigned.
  • Status changed to Fixed 5 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024