Fix the errors/warnings reported by PHP_CodeSniffer

Created on 19 June 2017, over 7 years ago
Updated 13 February 2024, 9 months ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml shows the following errors/warnings which should be fixed.

FILE: ./ek_health_check.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added
   |         | by drupal.org packaging automatically
 1 | WARNING | "core_version_requirement" property is missing in the
   |         | info.yml file
----------------------------------------------------------------------


FILE: ./ek_health_check.routing.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 6 | WARNING | Open page callback found, please add a comment before
   |         | the line why there is no access restriction
----------------------------------------------------------------------


FILE: ./src/Controller/HealthCheckController.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
  8 | ERROR | [x] Missing class doc comment
 10 | ERROR | [ ] Missing short description in doc comment
 11 | ERROR | [ ] Description for the @return value is missing
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 134ms; Memory: 6MB
📌 Task
Status

Needs work

Version

1.2

Component

Code

Created by

🇮🇳India Ravi Cmsminds

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work 10 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +/**
    + * Class HealthCheckController.
    + */

    A class description must not repeat the class name.

       /**
    +   * Function inex().
    +   *
        * @return \Symfony\Component\HttpFoundation\JsonResponse
    +   *   Function index \Symfony\Component\HttpFoundation\JsonResponse.
        */

    A method description must not repeat the method name (which in this case is also misspelled).
    A return value description must not repeat neither the method name nor the return value class/interface.

  • Hi,
    Addressed the above comments here.

Production build 0.71.5 2024