Fix the issues reported by phpcs

Created on 19 July 2023, 12 months ago
Updated 10 June 2024, 18 days 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 12 months ago
  • 🇮🇳India Harshita mehra

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

    Thanks!

  • Status changed to RTBC 11 months 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 11 months 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 11 months 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 18 days ago
  • 🇮🇳India dev16.addweb

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

  • Pipeline finished with Success
    18 days ago
    Total: 140s
    #195745
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.69.0 2024