repejota / phpnats

A PHP client for the NATSio cloud messaging system.

Home Page:http://nats.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adapt the code to PSR-2

josgilmo opened this issue · comments

We have to set the coding standard of psr-2:

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md

And add the correct rules to our sniffer.

I've just tried a little bit php-cs-fixer. Looks promising but:

I think we may switch from phpcs to php-cs-fixer but we must find a way to ask us to put docblocks ( and maybe more things ) and block all pull requests if the code do not follow this guidelines.

Probably we need to research a little bit more.

Right now changes following PSR-2 can be viewed here: https://github.com/repejota/phpnats/compare/feature/php-cs-fixer

This can help a lot:
http://stackoverflow.com/questions/13767550/is-there-a-phpcs-standard-targeting-php-docblocks

Totally thinking on using a mix between php-cs-fixer and php-code-sniffer 😄

After a few tests, i'm not gonna use potencier's fixer. I will continue using php code sniffer using the PS2 standard.

  • It has better support for PSR2
  • It shows also errors about docblocks
  • It is all installable throught composer