Fix the issues reported by phpcs

Created on 10 January 2023, almost 2 years ago
Updated 27 May 2023, over 1 year ago

Problem/Motivation

Steps to reproduce

Run :-

  • phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,md web/modules/contrib/autotagger

Remaining tasks

Fix all mentioned errors :-
FILE: web/modules/contrib/autotagger/autotagger.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------
67 | ERROR | The array declaration extends to column 112 (the limit is 80). The array content should be split up over multiple lines
429 | ERROR | Type hint "\Drupal\Core\Field\FieldItemList" missing for $field
429 | ERROR | Type hint "array" missing for $text_array
---------------------------------------------------------------------------------------------------------------------------------------

FILE: web/modules/contrib/autotagger/src/TagEvent.php
-----------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------------------
13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
17 | ERROR | Missing member variable doc comment
19 | ERROR | Missing member variable doc comment
21 | ERROR | Missing member variable doc comment
23 | ERROR | Missing member variable doc comment
-----------------------------------------------------------------------------------------------------------------

Time: 711ms; Memory: 10MB

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India vinaygawade Sawantwadi, Maharashtra

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.

  • Assigned to Sonal Gyanani
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work almost 2 years ago
  • Status changed to RTBC almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work almost 2 years ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +   * @param string $form_id
    +   *   The form id.
        *
        * @return mixed
    +   *   Set the form options to the plugin.

    It should be form ID, not form id.
    That is not a description for the return value.

    -      if ($field_type == 'entity_reference' && (in_array($field->getSettings()['target_type'], ['node', 'media']))) {
    +      $target_types = ['node', 'media'];
    +      if ($field_type == 'entity_reference' && (in_array($field->getSettings()['target_type'], $target_types))) {

    The difference is a few characters in length that are probably not worth for such a change.

  • First commit to issue fork.
  • @kkalashnikov opened merge request.
  • Status changed to Fixed over 1 year ago
  • 🇪🇸Spain alvar0hurtad0 Cáceres

    Thanks for the suggestions to all.
    I'm doing a deep re-architecture and your suggestions are make me think.

    For example this:

    -      if ($field_type == 'entity_reference' && (in_array($field->getSettings()['target_type'], ['node', 'media']))) {
    +      $target_types = ['node', 'media'];
    +      if ($field_type == 'entity_reference' && (in_array($field->getSettings()['target_type'], $target_types))) {
    

    Motivates this issue I've just created.
    https://www.drupal.org/project/autotagger/issues/3363099 📌 Move source fields to an annotation Fixed

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024