There are some coding standard issues in module.

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

jayesh.makwana created an issue. See original summary.

jayesh.makwana’s picture

We create a patch for solving coding standard issues for this module. Please check and apply it.

sidharth_soman’s picture

Hi, I am working on this.

sidharth_soman’s picture

Status: Active » Needs work

Finding a lot of errors relating to coding standard. Will fix.

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\entity_keyvalue.api.php
-----------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\entity_keyvalue.drush.inc
------------------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 16 WARNINGS AFFECTING 29 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] Missing file doc comment
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   3 | WARNING | [x] Unused use statement
  18 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Set "title" key for node 1'
  21 | WARNING | [x] A comma should follow the last multiline array item. Found: 'ekv-set'
  22 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  32 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Get value for "title" key for node 1'
  35 | WARNING | [x] A comma should follow the last multiline array item. Found: 'ekv-get'
  36 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  46 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Delete value for "title" key for node
     |         |     1'
  49 | WARNING | [x] A comma should follow the last multiline array item. Found: 'ekv-del'
  50 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  59 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Get all keys and its values for node
     |         |     1'
  62 | WARNING | [x] A comma should follow the last multiline array item. Found: 'ekv-get-all'
  63 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  72 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Delete all keys values for node 1'
  75 | WARNING | [x] A comma should follow the last multiline array item. Found: 'ekv-del-all'
  76 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  87 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 107 | ERROR   | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up
     |         |     over multiple lines
 122 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 144 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 146 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 153 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 158 | ERROR   | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 170 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 172 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 181 | ERROR   | [x] Closing brace indented incorrectly; expected 4 spaces, found 2
 195 | ERROR   | [x] Data types in @var tags need to be fully namespaced
 220 | ERROR   | [x] Data types in @var tags need to be fully namespaced
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\entity_keyvalue.info.yml
------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 1 | WARNING | "core_version_requirement" property is missing in the info.yml file
------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\entity_keyvalue.module
----------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 35 | ERROR | [x] Expected 1 space after closing parenthesis; found 4
 52 | ERROR | [x] Expected 1 space after closing parenthesis; found 4
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\README.txt
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------
 16 | WARNING | Line exceeds 80 characters; contains 204 characters
 17 | WARNING | Line exceeds 80 characters; contains 129 characters
 22 | WARNING | Line exceeds 80 characters; contains 82 characters
 35 | WARNING | Line exceeds 80 characters; contains 81 characters
 55 | WARNING | Line exceeds 80 characters; contains 91 characters
----------------------------------------------------------------------------------------------


FILE: ...ckendassignment\web\modules\contrib\entity_keyvalue-2888503\src\EntityKeyValueStore\EntityKeyValueStoreDefault.php
------------------------------------------------------------------------------------------------------------------------
FOUND 27 ERRORS AND 5 WARNINGS AFFECTING 26 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   7 | WARNING | [x] Unused use statement
   9 | WARNING | [x] Unused use statement
  13 | ERROR   | [x] Missing class doc comment
  15 | ERROR   | [ ] Missing short description in doc comment
  20 | ERROR   | [ ] Missing short description in doc comment
  21 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  21 | ERROR   | [x] Expected "EntityKeyValueStoreProvider" but found "EntityKeyValueStoreProvider." for @var tag in
     |         |     member variable comment
  25 | ERROR   | [ ] Missing short description in doc comment
  26 | ERROR   | [x] Data types in @var tags need to be fully namespaced
  26 | ERROR   | [x] Expected "KeyValueStoreInterface" but found "KeyValueStoreInterface." for @var tag in member
     |         |     variable comment
  33 | ERROR   | [ ] Missing parameter comment
  33 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  34 | ERROR   | [ ] Missing parameter comment
  34 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  34 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  56 | WARNING | [x] A comma should follow the last multiline array item. Found: $property
  92 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
 108 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
 140 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 224 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 239 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 255 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 283 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 6
 285 | ERROR   | [x] Closing brace indented incorrectly; expected 6 spaces, found 8
 306 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 309 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 319 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 322 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
 332 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 335 | ERROR   | [ ] Parameter tags must be grouped together in a doc comment
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: ...endassignment\web\modules\contrib\entity_keyvalue-2888503\src\EntityKeyValueStore\EntityKeyValueStoreInterface.php
------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AFFECTING 14 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
   4 | ERROR | [x] There must be one blank line after the namespace declaration
   9 | ERROR | [x] Missing interface doc comment
  14 | ERROR | [x] Data types in @param tags need to be fully namespaced
  25 | ERROR | [x] Data types in @param tags need to be fully namespaced
  30 | ERROR | [x] Expected "string" but found "string." for function return type
  38 | ERROR | [x] Data types in @param tags need to be fully namespaced
  49 | ERROR | [x] Data types in @param tags need to be fully namespaced
  69 | ERROR | [x] Data types in @param tags need to be fully namespaced
  76 | ERROR | [x] Expected "mixed" but found "mixed." for function return type
  89 | ERROR | [x] Data types in @param tags need to be fully namespaced
 104 | ERROR | [x] Data types in @param tags need to be fully namespaced
 121 | ERROR | [x] Data types in @param tags need to be fully namespaced
 134 | ERROR | [x] Data types in @param tags need to be fully namespaced
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\src\EntityKeyValueStoreProvider.php
------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
  33 | ERROR   | [x] Do not append variable name "$entityStoreConfig." to the type declaration in a member variable
     |         |     comment
  40 | ERROR   | [x] Do not append variable name "$defaultEntityStoreConfig." to the type declaration in a member
     |         |     variable comment
  52 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  54 | ERROR   | [x] Data types in @param tags need to be fully namespaced
  98 | ERROR   | [x] Data types in @return tags need to be fully namespaced
 108 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------


FILE: ...htdocs\backendassignment\web\modules\contrib\entity_keyvalue-2888503\src\Exception\EntityKeyValueTypeException.php
------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 4 | ERROR | [x] There must be one blank line after the namespace declaration
 7 | ERROR | [x] Missing class doc comment
 9 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

Time: 4.02 secs; Memory: 6MB
sidharth_soman’s picture

Assigned: sidharth_soman » Unassigned
Status: Needs work » Needs review
StatusFileSize
new23.17 KB

Fixed the issues. Please review my patch.
Thanks.

jatingupta40’s picture

Assigned: Unassigned » jatingupta40

I will review this patch

jatingupta40’s picture

Status: Needs review » Needs work

It resolves all the issues, but got two warnings of trailing white spaces in the README file, can you please remove them also.
Thanks.

jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
StatusFileSize
new35.16 KB
nitin_lama’s picture

Assigned: Unassigned » nitin_lama
mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new23.16 KB
new601 bytes

Updated patch #5 by addressing #7, please review it.

mrinalini9’s picture

Hey, @nitin_lama, Sorry haven't seen you have assigned it to yourself as my page was not refreshed and I was working on the same, and have already added a patch for this.

nitin_lama’s picture

StatusFileSize
new23.16 KB
new699 bytes

Updated patch. Fixed issues mentioned in #7. @mrinalini9 Please first assign the issue to yourself moving forward.

nitin_lama’s picture

Assigned: nitin_lama » Unassigned
jatingupta40’s picture

Assigned: Unassigned » jatingupta40

I will review this patch.

jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
Status: Needs review » Reviewed & tested by the community

Patch #12 is working absolutely fine and resolves all the PHP Coding standard issues.
Moving to RTBC.
Thanks.