Skip to content

Expand Section 2.5 entry in the PER-CS 2.0 to 3.0 migration guide#148

Open
rodrigoprimo wants to merge 1 commit into
php-fig:masterfrom
rodrigoprimo:add-symbol-rule-to-section-2.5-in-migration-guide-3.0
Open

Expand Section 2.5 entry in the PER-CS 2.0 to 3.0 migration guide#148
rodrigoprimo wants to merge 1 commit into
php-fig:masterfrom
rodrigoprimo:add-symbol-rule-to-section-2.5-in-migration-guide-3.0

Conversation

@rodrigoprimo

Copy link
Copy Markdown
Contributor

Section 2.5 in 3.0 defines how to split a compound type across multiple lines:

  • If the type contains only intersections or only unions, then each line MUST have a single type.
  • If the type contains both intersections and unions, then each line MUST have a single union segment. All intersections in a segment MUST be on the same line.
  • The symbol on which the compound type is split MUST be at the start of each line.

The migration guide's existing Section 2.5 entry compressed these into a single bullet that omitted the symbol at start requirement and was inaccurate for pure intersections.

These rules, along with the rest of the compound-type formatting conventions, were introduced by #45. This PR rewrites the splitting guidance into three bullets that match the spec, in the same order.

Section 2.5 existed in 2.0 but covered only keyword and type casing.
The entire compound-type subsection is new in 3.0.

The migration guide's existing Section 2.5 entry compressed the spec's
multi-line splitting rules into a single bullet that did not mention the
symbol at start of line requirement and was inaccurate for pure
intersections.

This commit rewrites the splitting guidance into three bullets that
match the spec, in the same order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant