Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alongosz
Copy link
Member

@alongosz alongosz commented Oct 23, 2025

🎫 Issue n/a

Related PRs:

Description:

Yet another pre-release step for 2.2.0.

Bumped PHP CS Fixer fixed version constraint to the latest v3.89.1.

We had some deprecated rules. New fixer introduced @PER-CS2x0 set in place of @PER-CS2.0 one.
Also there were some pre-existing deprecations for v3.75.0:

- Rule "braces" is deprecated. Use "single_space_around_construct", "control_structure_braces", "control_structure_continuation_position", "declare_parentheses", "no_multiple_statements_per_line", "braces_position", "statement_indentation" and "no_extra_blank_lines" instead.
- Rule "native_function_type_declaration_casing" is deprecated. Use "native_type_declaration_casing" instead.
- Rule "new_with_braces" is deprecated. Use "new_with_parentheses" instead.
- Rule "no_unneeded_curly_braces" is deprecated. Use "no_unneeded_braces" instead.

It was quite complicated for the braces, so hopefully I got it right.

Seems like some rules conflict with each other:

  1. braces_position and single_line_empty_body. The former one creates:
    function foo(): void {
    }
    however the latter one overrides it:
     function foo(): void {}
  2. blank_line_between_import_groups and no_extra_blank_lines. The former one:
    use Ibexa\Class\FQCN;
    
    use function foo;
    
    use Symfony\Class\FQCN;
    while the latter one refactors it to:
     use Ibexa\Class\FQCN;
     use function foo;
     use Symfony\Class\FQCN;

Defined explicitly in an ordered fashion (the last one seems to take precedence) for Ibexa 4.6 Rule Set. Ibexa 5.0 Rule Set relies on @PER-CS2x0 which sets these by default (experimented last week on admin-ui changes for main and it seemed not to produce any CS issues).

Tip

Note that the above are non-deterministic and depend on some factors unknown to me. ATM CI was not showing these issues, however locally without defining explicit order for these rules, I got CS issues reported.

- Rule "braces" is deprecated. Use "single_space_around_construct", "control_structure_braces", "control_structure_continuation_position", "declare_parentheses", "no_multiple_statements_per_line", "braces_position", "statement_indentation" and "no_extra_blank_lines" instead.
- Rule "native_function_type_declaration_casing" is deprecated. Use "native_type_declaration_casing" instead.
- Rule "new_with_braces" is deprecated. Use "new_with_parentheses" instead.
- Rule "no_unneeded_curly_braces" is deprecated. Use "no_unneeded_braces" instead.
@alongosz alongosz force-pushed the bump-php-cs-fixer-to-v3.89.0 branch from d55fce7 to def867a Compare October 23, 2025 12:33
Copy link

@konradoboza konradoboza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 but would be nice to see this "in action" to verify if there are rules that don't fit.

@alongosz
Copy link
Member Author

+1 but would be nice to see this "in action" to verify if there are rules that don't fit.

@konradoboza yeah, I'd like that too, but it's a bit difficult ATM, because of removal of FQCNs from the doc and multiline parameters. Applying 2.2.x-dev on core:main yields 2254 changed files due to #15, #16, and #13.

Maybe I'll try to cherry-pick this to 2.1.0 tag locally... :/

@konradoboza
Copy link

Maybe I'll try to cherry-pick this to 2.1.0 tag locally... :/

Didn't aim to suggest any additional work. We can iterate and decide once we start using bumped version.

alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 23, 2025
alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 23, 2025
alongosz added a commit to ibexa/core that referenced this pull request Oct 24, 2025
alongosz added a commit to ibexa/core that referenced this pull request Oct 24, 2025
alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 26, 2025
alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 26, 2025
alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 27, 2025
* The rule is configured in the `AbstractIbexaRuleSet`
`single_line_empty_body` tends to conflict with `braces_position` on some environments
…extra_blank_lines`

`blank_line_between_import_groups` tends to conflict with `no_extra_blank_lines` on some environments
@alongosz alongosz force-pushed the bump-php-cs-fixer-to-v3.89.0 branch from ab38329 to 3af3fa9 Compare October 27, 2025 12:48
@alongosz alongosz changed the title Bumped PHP CS Fixer to v3.89.0 and updated deprecated rules Bumped PHP CS Fixer to v3.89.1 and updated deprecated rules Oct 27, 2025
@sonarqubecloud
Copy link

alongosz added a commit to ibexa/admin-ui that referenced this pull request Oct 27, 2025
Files changed:

   1) src/lib/Tab/Dashboard/PagerLocationToDataMapper.php (fully_qualified_strict_types, ordered_imports)
   2) tests/bundle/ControllerArgumentResolver/ContentTreeChildrenQueryArgumentResolverTest.php (fully_qualified_strict_types)
   3) tests/lib/Form/DataTransformer/LanguageTransformerTest.php (fully_qualified_strict_types)
   4) tests/lib/Form/Data/FormMapper/ContentTypeDraftMapperTest.php (fully_qualified_strict_types, header_comment, blank_lines_before_namespace)
   5) tests/lib/Permission/LimitationResolverTest.php (fully_qualified_strict_types)
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.

3 participants