Fix the issues reported by phpcs

Created on 15 May 2023, over 1 year ago
Updated 16 May 2023, over 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal , DrupalPractice
/web/modules/contrib/asherry-3357279 /

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.


FILE: \modules\contrib\asherry-3357279\src\Plugin\ApiTools\RaveClient.php
---------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  5 | WARNING | [x] Unused use statement
  8 | ERROR   | [ ] Missing short description in doc comment
 22 | ERROR   | [x] Missing function doc comment
 30 | ERROR   | [x] Missing function doc comment
 37 | ERROR   | [x] Missing function doc comment
 39 | ERROR   | [x] Expected 1 blank line after function; 0 found
 40 | ERROR   | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------


FILE: \modules\contrib\asherry-3357279\src\Rave\SyncManager.php
-----------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
-----------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 11 | WARNING | [x] Unused use statement
 13 | ERROR   | [x] Missing class doc comment
 15 | ERROR   | [ ] Missing short description in doc comment
 35 | ERROR   | [x] Missing function doc comment
 47 | ERROR   | [ ] Description for the @return value is missing
 48 | ERROR   | [x] Separate the @return and @throws sections by a blank line.
 54 | WARNING | [x] A comma should follow the last multiline array item. Found: $identifier
 74 | ERROR   | [x] Expected 1 newline at end of file; 0 found
 74 | ERROR   | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------
📌 Task
Status

Fixed

Component

Code

Created by

🇮🇳India Shanu Chouhan

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 @Shanu Chouhan
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Shanu Chouhan

    Here's a patch for it.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +  /**
    +   * {@inheritdoc}
    +   */
       public function alerts($options = []) {

    The parent class does not have an alerts() method. {@inheritdoc} cannot be used for that documentation comment.

        * @return \Drupal\Core\Entity\EntityInterface
    +   *   The reloaded entity.
    +   *
        * @throws \Drupal\Core\Entity\EntityStorageException
        */
       public function syncAlert(array $result, &$counter = 0) {

    What that method returns is a message entity.

  • 🇺🇸United States asherry

    Thanks for the issue and the patch, the module is still a work in progress though. I don't honestly know if I'll keep those public methods, the client project where this is being worked on isn't even in the final development stages.

    I'll see if I can get your commit in there, just because I try to never turn down patches, but please be patient as this module will probably change before any type of release.

  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024