-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[0.x] Add Fixers for Laravel specific PHPDocs #3
Merged
Conversation
This file contains 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
wilsenhc
reviewed
Jun 22, 2022
Can you test fix the test suite, and in general adjust the coding style of the pull request? No final classes, no types, etc. |
I am sorry, but the types are defined in https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/src/Fixer/FixerInterface.php and need to be added. I of course can remove them in |
I will remove the types from the protected and private methods which are not from the interface. |
f22291d
to
1012d02
Compare
ablancobarreda
added a commit
to ablancobarreda/pint
that referenced
this pull request
Jan 5, 2023
3 upload images
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Fixes #1
The Laravel Code Style has the following style throughout the source code, which currently can not be described with PHP-CS-Fixer alone. This PR adds three new custom fixers for the laravel preset, which of course can be added to psr12 or symfony if the user wants to.
The Fixers are mostly copies with changes from the PHP-CS-Fixer Source Code.
Laravel/laravel_phpdoc_alignment
After
@param
should be two spaces then atype-hint
then another two spaces and then the$variable
Laravel/laravel_phpdoc_order
First should be the
description
after that@param
then@return
and at last@throws
The default rule
phpdoc_order
has a different order:description
,@param
,@throws
,@return
Laravel/laravel_phpdoc_seperation
Between each group of tags should be an empty line for seperation.
@param
and@return
are always of the same group and are not to be seperated with an empty line.The default behaviour for
phpdoc_seperation
is also an empty line between@param
and@return
.Additional Note:
There is still some Fixers which need to be implemented, e.g. that in the PHPDoc is full quantified class name is used, which also cannot be described by PHP-CS-Fixer alone:
You may take a look at https://github.com/adamwojs/php-cs-fixer-phpdoc-force-fqcn
though the complex type formatting is not tagged yet and there are still some problems with classes which are in the same namespace.