Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#154 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

@samdark đang làm issue này rồi.

Từ ngày 27/8/2026.

  • #157 của @samdark — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
php
Lĩnh vực
documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
284
Fork
27
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php-fig/per-coding-style

Tất cả issue của php-fig/per-coding-style

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.