Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update php-cs-fixer rules #760

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Update php-cs-fixer rules #760

merged 1 commit into from
Dec 21, 2021

Conversation

dbrumann
Copy link
Collaborator

@dbrumann dbrumann commented Dec 17, 2021

I was annoyed by the (for my taste) weirdly arranged use statements and some minor inconsistencies, so I updated the rules. Sorry, if this causes some inconvenience for open PRs.

Updated rules:

  • Ensure consistent array indentation
  • Always import not classes, functions and constants
  • Rearrange use statements by group (class, function, const)
  • use modern string methods like str_starts_with when possible We don't have Symfony's polyfill and I don't want to add it for the 1 change caused by this rule
  • use octal notation

@dbrumann
Copy link
Collaborator Author

I will leave this open for a while in case anyone has suggestions for other cs rules to change while we are at it or if there are any objections to the changes. Looking especially at you @staabm and @patrickkusebauch 😉

Copy link
Contributor

@staabm staabm left a comment

Choose a reason for hiding this comment

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

no strong feelings on my end - would be great we could the windows CI coverage before this one.

'self_static_accessor' => true,
'global_namespace_import' => [
Copy link
Collaborator

Choose a reason for hiding this comment

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

I usually do false, false, true, since everything apart of classes do not need the leading \ and it results in the smallest possible file.

But that is my personal preference.

 * Ensure consistent array indentation
 * Always import classes, functions and constants
 * Rearrange use statements alphabetically in groups
 * Use octal notation
@dbrumann dbrumann merged commit 836dfa0 into qossmic:main Dec 21, 2021
@dbrumann dbrumann deleted the cs_fix_rules branch December 21, 2021 07:24
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.

None yet

3 participants