Fix the issues reported by phpcs

Created on 19 July 2023, over 1 year ago
Updated 10 June 2024, 5 months ago
📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India Harshita mehra

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 @Harshita mehra
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Harshita mehra

    Hello Maintainers,
    I have provided a patch to fix this issue.
    Please review it.

    Thanks!

  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi Harshita mehna

    I applied your patch #2 to the module and I confirmed that it fixes all the PHPCS errors/issues.

    Please look at the screenshot I attached for your reference

    Thank you

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +    /** @var \Drupal\views_any_route\Plugin\views_any_route\ViewsAnyRouteDefault $access_plugin */
    +    /** @var \Drupal\views_any_route\Plugin\views_any_route\ViewsAnyRouteDefault $url_plugin */
    +    /** @var \Drupal\views_any_route\Plugin\views_any_route\ViewsAnyRouteDefault $link_plugin */

    Each of those comments should be placed right before the variables they describe, not put all together on the top.

       /**
        * Provide the options form.
        *
    -   * @param $form
    +   * @param \FormStateInterface $form
        *   The settings form.
    -   * @param FormStateInterface $form_state
    +   * @param \Drupal\Core\Form\FormStateInterface $form_state
        *   The state of the form.
        */
       public function buildOptionsForm(&$form, FormStateInterface $form_state) {

    Since that documentation comment is changed, Provide must be replaced with Provides.

    +      '#title' => $this->t('Additional Button Attributes'),
    +      '#description' => $this->t('Add one attribute string per line, without quotes (i.e. name=views_any_route).'),
    

    Since that line is changed, i.e. must be replaced with for example too.

     /**
    - * Class ViewsAnyRouteUtilities
    - * @package Drupal\views_any_route
    + * Class of ViewsAnyRouteUtilities.
    + *
    + * @package Drupal\views_any_route class
      */
     class ViewsAnyRouteUtilities {

    That description is still repeating the class name.

      /**
    -   * @param $delimiter
    -   * @param $string
    +   * Creates the object.
    +   *
    +   * @param array $delimiter
    +   *   Check we have a string.
    +   * @param array $string
    +   *   A string to be formatted.
    +   *
        * @return array
    +   *   Check we have a string.
        */

    The description is too broad.
    The return value description is not correct. It should answer to What value is returned? not What do we check?

    -      // Check we have a string like x=y, and not a string like =y , xy, or x=y=z.
    +    foreach (explode($delimiter, $string) as $line) {
    +      // Check we have a string: x=y, and not a string: =y , xy, or x=y=z.

    The comment is already correct as it is: You cannot replace like (the adverb) with colons. (You cannot replace spies like us with spies: us.)

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Assigned to imustakim
  • @imustakim opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India imustakim Ahmedabad

    Updated the MR as per the suggestion and fixed all the issue related to code sniffer.
    Please review.

  • Status changed to RTBC 5 months ago
  • 🇮🇳India dev16.addweb

    I've tested the !4 patch and it's working fine.

  • Pipeline finished with Success
    5 months ago
    Total: 140s
    #195745
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024