Fix the issues reported by phpcs

Created on 13 June 2023, about 1 year ago
Updated 15 June 2023, about 1 year ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/symfony_messenger/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
13 | WARNING | Line exceeds 80 characters; contains 94 characters
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/symfony_messenger/src/ResponseTrait.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
10 | ERROR | Doc comment is empty
15 | ERROR | Missing short description in doc comment
16 | ERROR | Missing parameter comment
18 | ERROR | Description for the @return value is missing
----------------------------------------------------------------------

FILE: ...l/vb/d_cont/symfony_messenger/src/DataCollector/MessengerDataCollector.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
9 | WARNING | [x] Unused use statement
13 | ERROR | [ ] Doc comment is empty
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...y_messenger/symfony_messenger_example/src/Controller/ExampleController.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 134ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix all the errors and warnings for Drupal and DrupalPractice coding standards

Remaining tasks

Patch review

📌 Task
Status

Needs review

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

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
       /**
    +   * Get the result from a handled message envelope.
    +   *
        * @param \Symfony\Component\Messenger\Envelope $envelope
    +   *   The message envelope.
        *
        * @return mixed
    +   *   The result from handling the message.

    The verb used in the description must be declined to the third person singular.

    The result from handling the message. is a bit too broad. The description should say exactly what is returned, especially when there are values returned in case of errors.

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    Fixes the issue providing patch.
    Please review.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -Messenger must be downloaded with Composer, and can be installed like any other Drupal module.
    +Messenger must be downloaded with Composer,
    +and can be installed like any other Drupal module.

    That line has been split too early, given that without exceeding 80 characters, the first line would be Messenger must be downloaded with Composer, and can be installed like any.

     /**
    - *
    + * Class to provide functionality for MessengerDataCollector.

    Saying that a class provides functionality for itself is not an helpful description, and it is also wrong since a class provides functionality to every class and function that uses it.

     /**
    - *
    + * A trait to provides method to extract the result from Symfony Messenger.
      */
     trait ResponseTrait {

    That description is quite vague too.

    +   * Retrieves the result from a Symfony Messenger envelope.
    +   *
        * @param \Symfony\Component\Messenger\Envelope $envelope
    +   *   The envelope containing the message result.
        *
        * @return mixed
    +   *   The result of the message handling.

    The result of the message handling. is not quiet different from The result from handling the message. If the latter is a bit too vague, the first is a bit too vague too. At least, it should say what exactly is returned.

  • Assigned to nitin_lama
  • 🇮🇳India nitin_lama

    Addressed #4. Updated patch.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
Production build 0.69.0 2024