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
Uniformize files coding style #1433
base: master
Are you sure you want to change the base?
Conversation
Most of these changes LGTM on their own, my only historical hesitation has been the affect it has on If we do make a change like this I'd also want to see enforcement of the rules in future by committing relevant config files and enforcing them in the GitHub workflows |
Because we're using Psalm already, if some of these rules (mostly type things) can be enforced by that instead / as well it'd be good to add them to the psalm config |
Aha https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view seems to address it |
If you can get the build passing and add a At some point we should/could set up a CS CI job |
9593800
to
13e6f6b
Compare
Hello @ciaranmcnulty First of all thank you so much for your attention regarding this PR. I have pushed:
|
I also think a tools like phpstan and/or php code style might do some good. |
Hello everyone
I'm very found of this project and try to convert everyone I know to use it when it's necessary
I've long wanted to do a contribution, and this is a complicated one (to me at list).
But beforehand I've noticed numerous inconsistencies in the coding styles files are using or use of syntax that are kinda old fashioned.
Such as array() which is useful for backward compatibility yes, but do we want to keep using it when using typed parameters in some files ?
Anyway this PR is here to discuss about this topic, and once this one will be settled I'll gladly make another one to uniformise all the typed parameters and attribute in all files.
Here are a few rule I've set using cs-fixer:
no_superfluous_phpdoc_tags: It's kind of pointless to comment the type of a typed parameter
array_syntax: use [] instead of array()
blank_line_before_statement: Some blank lines were missing between attributes
header_comment: Some file are missing the header comment
single_quote: Some file are using double quote when single is enough
visibility_required: Some function visibility were not declared
php_unit_method_casing: Enforce CamelCase case even for tests
Anyway I'll be glad to here from you before spending more time on this !
Cheers