Drupal Coding standard issues.

FILE: /var/www/html/Contribution/searchjson/search_json.module
----------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
----------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but
    |       |     found "\r\n"
 12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
    |       |     0
 25 | ERROR | [x] Short array syntax must be used to define arrays
 26 | ERROR | [x] Short array syntax must be used to define arrays
 27 | ERROR | [x] Short array syntax must be used to define arrays
 28 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /var/www/html/Contribution/searchjson/search_json.routing.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...www/html/Contribution/searchjson/src/Form/SearchjsonSettings.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 25 | ERROR | [x] Short array syntax must be used to define arrays
 28 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] Short array syntax must be used to define arrays
 39 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...html/Contribution/searchjson/src/Controller/SearchController.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 16 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Comments

Sivaprasad C created an issue. See original summary.

sivaprasadc’s picture

Assigned: sivaprasadc » Unassigned
Status: Active » Needs review
Issue tags: +short array syntax coding standards
StatusFileSize
new4.1 KB

Hi,

I have created the Patch for the same. PFA.

akash.addweb’s picture

@Sivaprasad C, Thanks for providing a patch, Your patch clears all the errors of the short array index. I verify with pareview & the errors you mentioned above. It is working fine for me.

akash.addweb’s picture

Status: Needs review » Reviewed & tested by the community

  • Sivaprasad C authored f2b8a4c on 8.x-1.x
    Issue #2959076 by Sivaprasad C: Use short array syntax (new coding...
pvsureshmca’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for fixing this issues Guys.

pvsureshmca’s picture

pvsureshmca’s picture

Status: Fixed » Closed (fixed)