Prepopulate module needs to be converted to use short array syntax as per new coding standard.

Comments

Munavijayalakshmi created an issue. See original summary.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Active » Needs review
StatusFileSize
new830 bytes
borisson_’s picture

Title: Convert module to use short array syntax (new coding standard). » Comply with coding standards
Status: Needs review » Needs work

This is correct, but this controller has a lot more coding standards issues. So we should fix all of them instead of just this one rule.

borisson_’s picture

Status: Needs work » Needs review
StatusFileSize
new3.71 KB
nkoporec’s picture

Created a reroll since #4 does no longer apply.

useernamee’s picture

Patch applies. phpcs still gives me some errors:

--standard=Drupal

FILE: ...les/contrib/prepopulate/src/Controller/prepopulateController.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
 13 | ERROR | [ ] Class name must begin with a capital letter
 16 | ERROR | [x] Doc comment short description must start with a
    |       |     capital letter
 30 | ERROR | [ ] Public method name
    |       |     "prepopulateController::_prepopulate_request_walk"
    |       |     is not in lowerCamel format
 30 | ERROR | [ ] Type hint "array" missing for &$form
 31 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

--standard=DrupalPractice

FILE: ...les/contrib/prepopulate/src/Controller/prepopulateController.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 19 | WARNING | \Drupal calls should be avoided in classes, use
    |         | dependency injection instead
 77 | WARNING | Node::load calls should be avoided in classes, use
    |         | dependency injection instead
----------------------------------------------------------------------
heddn’s picture

Status: Needs review » Closed (outdated)