Extend coding standard with new rules#15
Merged
nickvergessen merged 7 commits intomasterfrom Feb 1, 2024
Merged
Conversation
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
…8.4) Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
provokateurin
previously approved these changes
Jan 30, 2024
Member
provokateurin
left a comment
There was a problem hiding this comment.
The added rules look reasonable
ChristophWurst
previously approved these changes
Jan 30, 2024
Altahrim
previously approved these changes
Jan 31, 2024
Member
|
So that will be 1.2.0 right? |
Contributor
Author
Yeah could be, is there a version number to bump somewhere? |
Member
|
I would have expected composer.json but seems it's only the tag |
Signed-off-by: Côme Chilliet <[email protected]>
c178f60
Contributor
Author
|
Added missing entries to the changelog file, good to merge. |
provokateurin
approved these changes
Feb 1, 2024
nickvergessen
approved these changes
Feb 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposition to add these rules to our standard:
array_syntax: Force short syntax for arraylist_syntax: Same for listfully_qualified_strict_types: Remove namespace from classname when there is ausestatement, and add missing backslash for global namespaceno_leading_import_slash: Remove leading slash fromusestatementnullable_type_declaration_for_default_null_value: Add missing?on type declaration for parameters defaulting tonull. This will most likely be needed to avoid warnings in PHP 8.4.yoda_style: forbid yoda style comparision. This replacesnull === $aby$a === null.I undertand that adding rules will mean a huge changelog at some point, and confuse a bit git blame and backports, but I still think it is worth it.
It avoids doing such changes by hand when cleaning up old code, it avoids arguing about these things in PR review. It improves consistency across the codebase and makes it easier to read.
And for
nullable_type_declaration_for_default_null_valueit avoids future deprecation warnings (https://wiki.php.net/rfc/deprecate-implicitly-nullable-types - Not voted yet)