Fix the issues reported by phpcs

Created on 21 April 2023, about 1 year ago
Updated 24 April 2023, about 1 year ago

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/markdown_field_formatter/

FILE: /var/www/html/drupalvb/web/modules/contrib/markdown_field_formatter/src/Plugin/Field/FieldFormatter/MarkdownFileFormatter.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 20 ERRORS AND 1 WARNING AFFECTING 14 LINES
-----------------------------------------------------------------------------------------------------------------------------------
26 | ERROR | [ ] Missing short description in doc comment
27 | ERROR | [x] Data types in @var tags need to be fully namespaced
33 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
33 | ERROR | [ ] Missing parameter comment
33 | ERROR | [ ] Missing parameter type
34 | ERROR | [ ] Missing parameter comment
34 | ERROR | [ ] Missing parameter type
35 | ERROR | [ ] Missing parameter comment
35 | ERROR | [x] Data types in @param tags need to be fully namespaced
36 | ERROR | [ ] Missing parameter comment
37 | ERROR | [ ] Missing parameter comment
37 | ERROR | [ ] Missing parameter type
38 | ERROR | [ ] Missing parameter comment
38 | ERROR | [ ] Missing parameter type
39 | ERROR | [ ] Missing parameter comment
40 | ERROR | [ ] Missing parameter comment
40 | ERROR | [x] Data types in @param tags need to be fully namespaced
80 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
92 | WARNING | [x] A comma should follow the last multiline array item. Found: $output
96 | ERROR | [x] Expected 1 blank line after function; 0 found
97 | ERROR | [x] The closing brace for the class must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupalvb/web/modules/contrib/markdown_field_formatter/markdown_field_formatter.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

Time: 181ms; Memory: 10MB

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India dineshkumarbollu

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

    Added patch for fix coding standards .

  • 🇮🇳India Raveen Kumar

    I have reviewed patch #2. And it seems as per coding standards. Thank you.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am reviewing the patch in comment #2.

    +   * @param string $plugin_id
    +   *   The plugin_id parameter.
    +   * @param mixed $plugin_definition
    +   *   The Plugin_definition parameter.
    

    It is not how parameters are described. For example, there is no need to say that a parameter is... a parameter.

    +   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
    +   *   The FeildDefintion service.

    There are two typos.

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India Soham Sengupta

    Hi, I have updated the parameter comments.

  • 🇮🇳India chanderbhushan

    @apaderno, could you please check in Drupal core code there also same defined

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -   * @var EntityTypeManagerInterface
    +   * Entity Type Manager service.
    +   *
    +   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
        */

    In English, there are rules about which words are written capitalized. On Entity Type Manager only the first word is correctly spelled.
    There is a missing article, in the short description.

    +   * @param string $plugin_id
    +   *   The plugin_id for the formatter.
    +   * @param mixed $plugin_definition
    +   *   The plugin implementation definition.

    It is redundant to say that the $plugin_id parameter is the plugin_id of the formatter, since that is repeating the parameter name.
    The correct description for those parameters can be seen in constructors like PluginBase::__construct(), for example.

    +   * @param string $label
    +   *   The formatter label display setting.

    It is sufficient to say The formatter label.

        * @param array $third_party_settings
    -   * @param EntityTypeManagerInterface $entity_type_manager
    +   *   Any third party settings.
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    +   *   The Entity type manager service.

    Any>/em> is not necessary.
    Entity is misspelled, since it is not at the beginning of the sentence (contrary to The).

  • Status changed to Needs review about 1 year ago
  • 🇮🇳India Akram Khan Cuttack, Odisha

    addressed #9

Production build 0.69.0 2024