Skip to content

Set SectionCommentsFixer priority to 54 to satisfy run-order constraints #9377

Closed

Description

@live627

We need to set a safe priority for SectionCommentsFixer so its run order satisfies constraints relative to existing built-in fixers.

Requirements

  • Must run before: IndentationTypeFixer (priority 50), NoExtraBlankLinesFixer (-20), StatementIndentationFixer (-3)
  • Must run after: ClassAttributesSeparationFixer (priority 55), ModifierKeywordsFixer (priority 56), OrderedClassElementsFixer (priority 65)

Analysis

To meet the constraints we need priority p such that:

  • p > 50 (to run before IndentationTypeFixer)
  • p < 55 (to run after ClassAttributesSeparationFixer)

Allowed integer priorities: 51, 52, 53, 54.

Recommendation

Set priority to 54. Rationale:

  • 54 is the highest number in the allowed range so it runs after ClassAttributesSeparationFixer@55 and before IndentationTypeFixer@50.
  • Choosing the highest available value preserves the requested ordering while leaving room for adjacent fixers to be inserted between 54 and 55 if needed in the future.

Example patch (conceptual):

public function getPriority(): int
{
    return 54;
}

Upstream provides integration testing that I use to test these priorities. My tests are at live627/php-cs-fixer-custom-fixers@747a918

That repository might be a good candidate to move to the organization. I might post about this in the team boards one day.

Activity

  1. Sesquipedalian commented on Aug 7, 2026

    @Sesquipedalian
    Member

    Sounds like a good idea to me.

  2. added this to the 3.0 Alpha 5 milestone on Aug 8, 2026
  3. added theissue type on Aug 8, 2026
  4. jdarwood007 commented on Aug 8, 2026

    @jdarwood007
    Member

    This is independent of #9265 correct?

  5. self-assigned this
    on Aug 9, 2026
  6. live627 commented on Aug 9, 2026

    @live627
    ContributorAuthor

    that's right

  7. linked a pull request that will close this issueupdate fixer priority #9777on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions