Closed (fixed)
Project:
Pathauto
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
29 Jan 2019 at 19:11 UTC
Updated:
20 Feb 2019 at 20:54 UTC
Jump to comment: Most recent, Most recent file
For Some PHP files Short array syntax should be used
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | Short_array_syntax_used-3029311-12.patch | 104.57 KB | akshay_d |
| #9 | Short_array_syntax_used-3029311-9.patch | 103.94 KB | akshay_d |
| #7 | Short_array_syntax_used-3029311-6.patch | 103.94 KB | akshay_d |
| #5 | Short_array_syntax_used-3029311-5.patch | 103.49 KB | akshay_d |
| #3 | phpcs_report.txt | 61.57 KB | bnjmnm |
Comments
Comment #2
akshay_dThe short array syntax is used for the Following
src/Form/PathautoBulkUpdateForm.php
src/Form/PathautoSettingsForm.php
src/Form/PatternEnableForm.php
Comment #3
bnjmnmI found several dozen additional instances that need to be converted to short array syntax. The PHP Code sniffer report is attached - additional code standard violations are listed but you can focus on the
Short array syntax must be used to define arraysones.Also want to make sure you're aware of this if you aren't already https://www.drupal.org/docs/8/modules/code-review-module/installing-code.... Once you have this installed, you can generate reports such as the one attached, and quickly identify areas that need code standards fixes.
Comment #4
akshay_dThanks for the inputs I will fix rest short array syntax soon.
Comment #5
akshay_dFixed the Short array syntax Coding standards
Comment #7
akshay_dConsider the last patch Updated all the changes
Comment #9
akshay_dfixed Short array syntax
Comment #11
bnjmnmA local code sniffer would catch these errors so you can confirm a patch works before uploading it here. Drupal Slack can be a good place to get assistance if you're having trouble getting the steps in the Code sniffer guide to work.
You'll eventually want to get testing set up on your local environment as well. The initial setup is a bit of work and probably not necessary for this specific task, but will make contributing to future issues much easier.
Comment #12
akshay_dFixed Short array syntax
Comment #13
akshay_dPlease Review
Comment #14
berdirThanks. Found one more and fixed that too.
I fear you did that by hand. You might want to know that there are scripts for that, see how core did it: #2776975: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase