You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should the single space around => be stated as a general rule instead of per construct? #154
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?
Might be a good idea to have a good think about the phrasing as I think forbidding the aligning of double arrows when the construct is multi-line, may not be the intention... ?
Activity
samdark commentedon Jun 30, 2026
Good catch 👍 Personally, I think having it as a general rule makes sense.
Crell commentedon Jun 30, 2026
I concur. What would be the best way/place to phrase that?
jrfnl commentedon Jul 3, 2026
Might be a good idea to have a good think about the phrasing as I think forbidding the aligning of double arrows when the construct is multi-line, may not be the intention... ?