Fix the issues reported by phpcs

Created on 30 October 2022, about 2 years ago
Updated 26 January 2024, 10 months ago

Problem/Motivation

FILE: /home/system/Documents/contribution/custom_breadcrumbs-3318181/src/BreadcrumbBuilder.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 151 | WARNING | The removal-version 'custom_breadcrumbs' does not match the lower-case machine-name standard: drupal:n.n.n or project:n.x-n.n or project:n.x-n.n-label[n] or project:n.n.n or
     |         | project:n.n.n-label[n]
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 126ms; Memory: 10MB

FILE: /home/system/Documents/contribution/custom_breadcrumbs-3318181/src/BreadcrumbBuilder.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
 152 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

Time: 96ms; Memory: 8MB

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml custom_breadcrumbs 
๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia PrasadDeole

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.

  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India

    Patch #3 is failed to apply.
    Updated patch accordingly.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akram Khan Cuttack, Odisha

    checked patch #7 it apply cleanly and Fix phpcs coding standards issue

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akram Khan Cuttack, Odisha

    Forgot to added SS

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

    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.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    +      '#description' => $this->t('One url per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.',
    +        [
    +          '@token' => 'https://www.drupal.org/project/token',
    +          '@nolink_key' => '<nolink>',
    +        ]
    +      ),

    url is not spelled correctly.

  • Merge request !33318181: PHPCS codding standard โ†’ (Merged) created by kkalashnikov
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India

    @apaderno thanks for reviewing. I have created MR of patch #7 and include commented change as well.
    Please review.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kkalashnikov Ghaziabad, India
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    -      '#description' => $this->t('One url per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.', ['@token' => 'https://www.drupal.org/project/token', '@nolink_key' => '<nolink>']),
    +      '#description' => $this->t('One URL per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.',
    +        [

    URL is an acronym and it is only written in one way. Also, since that sentence is going to be changed, also must start from needs to be corrected, since the correct phrase is must start with.
    Then, One url per line, you can use Token module. is a comma-splice sentence. Instead of the comma, it should use a period because those are two different sentences.

    + '#description' => $this->t("A set of patterns separated by a newline. @front_key@ is used to front page. The * character is a wildcard. An example path is /admin/* for every admin pages.",

    The correct phrase is is used for the front page, not is used to front page.

    + '#description' => $this->t('One URL per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.',

    An article is missing before <a href="@token">Token</a> module.

    The Needs work status was also set for the issue summary, which does not show what arguments has been passed to phpcs.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rassoni Bangalore
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
    - * Configure the user permissions in Administration ร‚ยป People ร‚ยป Permissions:
    + * Configure the user permissions in
    + Administration ร‚ยป People ร‚ยป Permissions:

    The last line must be indented.

     /**
    - * Class BreadcrumbBuilder.
    + * Breadcrumb builder class.

    That is still repeating the class name. Splitting the class name in two words does not change that is the class name.

    -      '#description' => $this->t('One url per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.', ['@token' => 'https://www.drupal.org/project/token', '@nolink_key' => '<nolink>']),
    +      '#description' => $this->t('One URL per line, you can use <a href="@token">Token</a> module. Url must start from "/". Use @nolink_key if you don\'t want to set a link for the respective title.',
    +        [
    +          '@token' => 'https://www.drupal.org/project/token',
    +          '@nolink_key' => '<nolink>',
    +        ]
    +      ),


    One URL per line, you can use Token module.
    is a comma-splice sentence (a grammatical error). Instead of a comma, a semicolon or a period must be used.
    Url is still a misspelled word. (Acronyms are always in upper-case characters.)

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

    nitin_lama โ†’ changed the visibility of the branch 3318181-fix-phpcs-coding to hidden.

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

    nitin_lama โ†’ changed the visibility of the branch 3318181-fix-phpcs-coding to active.

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

    Rebased and pushed changes. Updating IS for the remaining issues.

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Status changed to Fixed 11 months ago
  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024