Fix all the PHPCS and Pareview errors to meet Drupal standard & practices

Pareview test: https://pareview.sh/pareview/https-git.drupal.org-project-popup_dialog

PHPCS test: phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md popup_dialog

PHPCS Best Practices test: phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md popup_dialog`

Comments

Munavijayalakshmi created an issue. See original summary.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Status: Active » Needs review
StatusFileSize
new2.26 KB
dhruveshdtripathi’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new37.52 KB

Patch applied cleanly. All the arrays converted to short array syntax. Checked it manually.

Good work!

imalabya’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
imalabya’s picture

Status: Reviewed & tested by the community » Needs work
imalabya’s picture

The patch doesn't apply to 8x-2.x branch.

imalabya’s picture

Status: Needs work » Postponed
imalabya’s picture

Title: Convert module to use short array syntax (new coding standard). » Fix PHPCS & Pareview.sh errors
Issue summary: View changes
Status: Postponed » Active

Updated the issue to fix all the PHPCS and Pareview errors

imalabya’s picture

Issue summary: View changes
nishantkumar155’s picture

Status: Active » Needs review
StatusFileSize
new7.83 KB

Please review my patch # 10.

imalabya’s picture

Status: Needs review » Needs work

Thanks for the patch. Please fix the below errors for PHPCS and PHPBP

FILE: ...WebServer/Docroot/popup/modules/popup_dialog/popup_dialog.module
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
 27 | ERROR | [x] Short array syntax must be used to define arrays
 69 | ERROR | [x] Short array syntax must be used to define arrays
 74 | ERROR | [x] Short array syntax must be used to define arrays
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rver/Docroot/popup/modules/popup_dialog/popup_dialog.routing.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 11 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ocroot/popup/modules/popup_dialog/src/Form/PopupSettingsForm.php
----------------------------------------------------------------------
FOUND 19 ERRORS AND 1 WARNING AFFECTING 20 LINES
----------------------------------------------------------------------
  37 | ERROR   | [x] Short array syntax must be used to define arrays
  43 | ERROR   | [x] Short array syntax must be used to define arrays
  49 | ERROR   | [x] Short array syntax must be used to define arrays
  52 | ERROR   | [x] Short array syntax must be used to define arrays
  59 | ERROR   | [x] Short array syntax must be used to define arrays
  63 | ERROR   | [x] Short array syntax must be used to define arrays
  64 | ERROR   | [x] Short array syntax must be used to define arrays
  65 | ERROR   | [x] Short array syntax must be used to define arrays
  69 | ERROR   | [x] Short array syntax must be used to define arrays
  96 | ERROR   | [x] Short array syntax must be used to define arrays
 100 | ERROR   | [x] Short array syntax must be used to define arrays
 101 | ERROR   | [x] Short array syntax must be used to define arrays
 102 | ERROR   | [x] Short array syntax must be used to define arrays
 115 | ERROR   | [x] Short array syntax must be used to define arrays
 119 | ERROR   | [x] Short array syntax must be used to define arrays
 120 | ERROR   | [x] Short array syntax must be used to define arrays
 121 | ERROR   | [x] Short array syntax must be used to define arrays
 138 | ERROR   | [x] Short array syntax must be used to define arrays
 145 | ERROR   | [x] Short array syntax must be used to define arrays
 157 | WARNING | [ ] Possible useless method overriding detected
----------------------------------------------------------------------
PHPCBF CAN FIX THE 19 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 171ms; Memory: 4Mb
FILE: ...rver/Docroot/popup/modules/popup_dialog/popup_dialog.routing.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 9 | WARNING | The administration page callback should probably use
   |         | "administer site configuration" - which implies the
   |         | user can change something - rather than "access
   |         | administration pages" which is about viewing but not
   |         | changing configurations.
----------------------------------------------------------------------


FILE: ...ocroot/popup/modules/popup_dialog/src/Form/PopupSettingsForm.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 85 | WARNING | \Drupal calls should be avoided in classes, use
    |         | dependency injection instead
 86 | WARNING | \Drupal calls should be avoided in classes, use
    |         | dependency injection instead
----------------------------------------------------------------------

Time: 57ms; Memory: 4Mb
chishah92’s picture

Assigned: Unassigned » chishah92
Status: Needs work » Needs review
StatusFileSize
new12.74 KB

Have Fixed the Errors in this patch

imalabya’s picture

Status: Needs review » Needs work
StatusFileSize
new660.12 KB

NW Please fix the errors listed

Issues

mashir’s picture

Assigned: chishah92 » mashir
Status: Needs work » Needs review
StatusFileSize
new14.56 KB

Patch attached with all fixed.

  • malavya committed 1db2f13 on 8.x-2.x authored by Mashir
    Issue #2871389 by Munavijayalakshmi, nishantkumar155, chishah92, Mashir...
imalabya’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch @Mashir

imalabya’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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