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

Use php-cs-fixer to automatically format our code #435

Closed
pascalchevrel opened this Issue Feb 13, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@pascalchevrel
Member

pascalchevrel commented Feb 13, 2015

There is a great tool created by Fabien Potencier (creator of the Symfony framework) that automatically reformat your PHP code according to a set of code conventions.
By default they are Symfony code conventions but the tool is now a standalone one and it supports PSR and user contributed rules too now:

https://github.com/FriendsOfPHP/PHP-CS-Fixer

I tried it locally and it should help us keep consistency I think, I created a set of rules that reflect what we do in the project (basically PSR2 + most rules from symfony).

That means that once we are ready to provide a patch, we just have to go to the root of the project and type:

php-cs-fixer fix

And all the new code we have written will be fixed to follow our standards. Seems that it can also be hooked into Travis.

PR coming.

@pascalchevrel pascalchevrel self-assigned this Feb 13, 2015

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Feb 13, 2015

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Feb 13, 2015

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Feb 13, 2015

pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Feb 13, 2015

pascalchevrel added a commit that referenced this issue Feb 13, 2015

Merge pull request #436 from pascalchevrel/php-cs-fixer
Issue #435: use php-cs-fixer for code consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment