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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

roshni27’s picture

roshni27 created an issue.
I am working on it.

roshni27’s picture

Issue summary: View changes
roshni27’s picture

Assigned: roshni27 » Unassigned

roshni27’s picture

Status: Active » Needs work

I have solved some error and there are still remain errors related to phpcs. please review solved errors.

roshni27’s picture

Status: Needs work » Needs review

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

avpaderno’s picture

Issue tags: -Code Standards, -Needs issue summary update +Coding standards
shiv_sharma’s picture

Status: Needs review » Needs work
StatusFileSize
new157 KB

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

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

zniki.ru made their first commit to this issue’s fork.

nikolay shapovalov’s picture

Status: Needs work » Needs review

MR 1 update, please make a review.

  • Gogowitsch committed eca63897 on 8.x-1.x
    Issue #3372375: Fix the warnings/errors reported by PHP_CodeSniffer
    
gogowitsch’s picture

Status: Needs review » Fixed

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: Fixed » Closed (fixed)

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