-
Notifications
You must be signed in to change notification settings - Fork 147
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
[0.x] Add Fixers for Laravel specific PHPDocs #3
Conversation
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
3 upload images
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.