Destructuring syntax (list() and [])
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
Start by checking how PSR-12 and PHP_CodeSniffer handle spacing in list() and [] destructuring; the issue provides reproducible input in my-file.php and the expected formatting. Run phpcs --standard=PSR12 against both shown examples, then confirm that missing spaces after the comma are reported and the corrected forms pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I want to report a case that does not seem to be explicitly covered by PSR-12.
It concerns variable destructuring using the list() and [] syntaxes.
I have this code:
[$val1,$val2] = explode(',', $string);
list($val1,$val2) = explode(',', $string);
And I do not get any error when running the command:
phpcs --standard=PSR12 my-file.php
In my opinion, there should be a space required after the comma following $val1, as in function calls or arrays.
Correction:
[$val1, $val2] = explode(',', $string);
list($val1, $val2) = explode(',', $string);
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 284
- Fork
- 28
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di php-fig/per-coding-style
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
php-fig/per-coding-style#159 · 2 commenti ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
php-fig/per-coding-style#154 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
php-fig/per-coding-style#149 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 35/100
php-fig/per-coding-style#131 · 1 commento ·
Tutte le issue di php-fig/per-coding-style
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
browser-use/browser-use#5905 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MetOffice/SimSys_Scripts#255 ·
-
Support bun dedupe Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
antfu/node-modules-inspector#214 ·
-
curriculum documentation quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
githubnext/gh-aw-workshop#3810 ·