UPDATE: slevomat coding standards & Fixes#22
Merged
mantebalzaraviciute merged 4 commits intomainfrom Mar 23, 2023
Merged
Conversation
AlexJump24
approved these changes
Mar 7, 2023
dannewnsjump24
approved these changes
Mar 9, 2023
AlexJump24
approved these changes
Mar 9, 2023
mmorganJ24
reviewed
Mar 9, 2023
Contributor
Author
|
Dan told me to add myself and remove Steve :D |
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.
Updated Slevomat as they added a new Sniff
$services->set(BackedEnumTypeSpacingSniff::class);requested by @AlexJump24What: Checks the amount of spaces that is before and after the colon on the enum definition
Why: So we can keep our code consistent 🙏🏼
MantesEnum: string$services->set(NamespaceSpacingSniff::class);What: A little sniff to check that there is one line above the namespace and one below👃🏻
Why: To keep it nice and consistent
$services->set(MethodSpacingSniff::class);What: Enforces one new line between methods ✅
Why: Another sniff to check the spacing between our methods
$services->set(UnusedFunctionParameterSniff::class);What: Checks for unused parameters in functions
Why: Helps us keep our code clean and only have parameters we use 🤓
Removed:
$services->set(DisallowMixedTypeHintSniff::class);❌Why: Sometimes we need to have mixed in the doc blocks, but i disallowed mixed in return types and param types, will make a new PR with a custom sniff that will allow us to have mixed in the doc blocks but not the code itself.
What: Updated the sniff to have 0 spaces around the equals as the fixer adds them without spaces 👍🏻
Why: To keep it nice and consistent 😎
Why: Added some excludes for type hints. The above ignore the missing native type hint when the doc block is present. This is needed as we override some Laravel methods that do not like type hints. 🥲 This way the fixer doesn't remove the doc blocks and insert them into param type hints and break the app due to incompatibilities 🔥