Fix the warnings/errors reported by PHP_CodeSniffer

Created on 5 July 2023, 12 months ago
Updated 21 November 2023, 7 months ago

Problem/Motivation

FILE: .../lenovo/druapl7to9/web/modules/contrib/email_attachment-3372375/modules/email_attachment_demo/email_attachment_demo.info.yml
----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
 14 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
----------------------------------------------------------------------------------------------------------------------------------


FILE: ...me/lenovo/druapl7to9/web/modules/contrib/email_attachment-3372375/modules/email_attachment_demo/email_attachment_demo.module
----------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
  3 | ERROR   | Missing short description in doc comment
 14 | WARNING | Hook implementations should not duplicate @param documentation
 14 | ERROR   | Missing parameter comment
----------------------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/email_attachment-3372375/tests/src/Kernel/EmailAttachmentTest.php
-------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------
  15 | ERROR | Missing member variable doc comment
  19 | ERROR | Missing short description in doc comment
  23 | ERROR | Doc comment is empty
  31 | ERROR | Doc comment is empty
  43 | ERROR | Doc comment is empty
  55 | ERROR | Doc comment is empty
  71 | ERROR | Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
  76 | ERROR | String concat is not required here; use a single string instead
  77 | ERROR | String concat is not required here; use a single string instead
  89 | ERROR | Doc comment is empty
 104 | ERROR | Doc comment is empty
 112 | ERROR | Doc comment is empty
 121 | ERROR | Doc comment is empty
-------------------------------------------------------------------------------------------------------------------


FILE: /home/lenovo/druapl7to9/web/modules/contrib/email_attachment-3372375/email_attachment.module
----------------------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 3 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------------------
  16 | WARNING | Hook implementations should not duplicate @param documentation
  16 | ERROR   | Missing parameter comment
  30 | ERROR   | All functions defined in a module file must be prefixed with the module's name, found "_convert_to_multipart"
     |         | but expected "email_attachment__convert_to_multipart"
  59 | ERROR   | Missing short description in doc comment
  63 | ERROR   | Parameter comment must start with a capital letter
  65 | ERROR   | Description for the @return value is missing
  67 | ERROR   | All functions defined in a module file must be prefixed with the module's name, found "_add_attachment" but
     |         | expected "email_attachment__add_attachment"
 110 | ERROR   | Doc comment is empty
 113 | ERROR   | All functions defined in a module file must be prefixed with the module's name, found "_encode_header_rfc_2184"
     |         | but expected "email_attachment__encode_header_rfc_2184"
 118 | ERROR   | join() is a function name alias, use implode() instead
 124 | WARNING | Hook implementations should not duplicate @param documentation
 124 | ERROR   | Missing parameter comment
 124 | ERROR   | Missing parameter type
 125 | WARNING | Hook implementations should not duplicate @param documentation
 125 | ERROR   | Missing parameter comment
 125 | ERROR   | Missing parameter type
----------------------------------------------------------------------------------------------------------------------------------

Time: 105ms; 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 email_attachment-3372375/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

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

Merge Requests

Comments & Activities

  • Issue created by @roshni27
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27
  • Merge request !1fixes issues related phpcs โ†’ (Closed) created by roshni27
  • Status changed to Needs work 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    there are still remain errors related to phpcs

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia roshni27

    Remove empty comment and function name changes according to above mention comment. Please review new PR.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shiv_Sharma

    Seem there are more fixes need to done as after applying patch still showing phpcs warning to me.

    FILE: /home/shivsharma/project/new/web/modules/contrib/email_attachment/tests/src/Kernel/EmailAttachmentTest.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 14 ERRORS AFFECTING 14 LINES
    ----------------------------------------------------------------------------------------------------------------
      15 | ERROR | [ ] Missing member variable doc comment
      19 | ERROR | [ ] Missing short description in doc comment
      23 | ERROR | [x] Whitespace found at end of line
      24 | ERROR | [x] Missing function doc comment
      29 | ERROR | [x] Missing function doc comment
      40 | ERROR | [x] Missing function doc comment
      49 | ERROR | [x] Missing function doc comment
      62 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
      69 | ERROR | [ ] String concat is not required here; use a single string instead
      70 | ERROR | [ ] String concat is not required here; use a single string instead
      82 | ERROR | [x] Missing function doc comment
      94 | ERROR | [x] Missing function doc comment
      99 | ERROR | [x] Missing function doc comment
     105 | ERROR | [x] Missing function doc comment
    ----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/shivsharma/project/new/web/modules/contrib/email_attachment/email_attachment.module
    ----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 10 ERRORS AND 3 WARNINGS AFFECTING 8 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------
      16 | WARNING | Hook implementations should not duplicate @param documentation
      16 | ERROR   | Missing parameter comment
      59 | ERROR   | Missing short description in doc comment
      65 | ERROR   | Description for the @return value is missing
     110 | ERROR   | Doc comment is empty
     113 | ERROR   | All functions defined in a module file must be prefixed with the module's name, found "_encode_header_rfc_2184" but expected
         |         | "email_attachment__encode_header_rfc_2184"
     118 | ERROR   | join() is a function name alias, use implode() instead
     124 | WARNING | Hook implementations should not duplicate @param documentation
     124 | ERROR   | Missing parameter comment
     124 | ERROR   | Missing parameter type
     125 | WARNING | Hook implementations should not duplicate @param documentation
     125 | ERROR   | Missing parameter comment
     125 | ERROR   | Missing parameter type
    ----------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/shivsharma/project/new/web/modules/contrib/email_attachment/modules/email_attachment_demo/email_attachment_demo.module
    ----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------
     15 | WARNING | Hook implementations should not duplicate @param documentation
     15 | ERROR   | Missing parameter comment
    ----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/shivsharma/project/new/web/modules/contrib/email_attachment/modules/email_attachment_demo/email_attachment_demo.info.yml
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------
     14 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    ------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 135ms; Memory: 10MB
    
    
  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    zniki.ru โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 7 months ago
  • ๐Ÿ‡ท๐Ÿ‡บRussia zniki.ru

    MR 1 update, please make a review.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Gogowitsch

    Thanks everyone. I have merged your proposed changes, except for these points:

    • I changed the names of the functions so they start with an underscore to show that they are internal, including the @internal annotation.
    • I fixed the project name in `modules/email_attachment_demo/email_attachment_demo.info.yml`
    • I re-added some of the `@param` annotations that were removed in this MR.
  • Status changed to Fixed 7 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024