Skip to content
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
Closed

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

pascalchevrel opened this issue Feb 13, 2015 · 0 comments
Assignees

Comments

@pascalchevrel
Copy link
Member

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
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
Projects
None yet
Development

No branches or pull requests

1 participant