Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Should the single space around `=>` be stated as a general rule instead of per construct?

Aperta
#154 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
php
Ambito
documentation

Direzione di ricerca

Start in spec.md by comparing sections 4.9, 5.2, 5.5, 7.1, and 11, including their examples and stated spacing rules. Check the existing discussion for rationale, then document the agreed consistent rule in the relevant section or as a general rule, with examples and wording aligned throughout.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

PER explicitly requires a single space around the => symbol in two sections:

Section 7.1 (Short Closures):

The => symbol MUST be preceded and succeeded by a space.

Section 4.9 (Property Hooks):

There MUST be a single space on either side of the => symbol.

The same operator is used in other constructs, but as far as I could check the spec does not state the spacing around it explicitly for them. Arrays (section 11), match (section 5.2) and foreach (section 5.5) only show a single space in their examples. There might be other places where => is used, but I haven't checked them all.

Is there a reason the rule is stated only for short closures and property hooks that I'm missing, or would it make sense to state it as a general rule so that it applies consistently to every use of =>? If there is a reason not to create a general rule, should it be added to the array, match and foreach sections?

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di php-fig/per-coding-style

Tutte le issue di php-fig/per-coding-style

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.