thegreenwebfoundation / greencheck-api

The green web foundation API
https://www.thegreenwebfoundation.org/
Apache License 2.0
9 stars 3 forks source link

[greencheck] Update codestyle to PSR2/Symfony #3

Closed arendjantetteroo closed 1 month ago

arendjantetteroo commented 5 years ago

Some parts still look like the php4 age with _ for properties.

mrchrisadams commented 5 years ago

OK @arendjantetteroo as far as I can tell, this would largely be a case of running part of the codebase through something like PHP codesniffer, right?

Once we have this, we can then think about either adding it to CI pipeline, or locally with something like Pre-Commit

arendjantetteroo commented 5 years ago

Some of it might be automatically fixed by php-cs-fixer maybe, others might need some manual changes.

pre-commit should help yes.

arendjantetteroo commented 5 years ago

Code style should be ok now (except for maybe a few small issues here and there).

Still to do : add a pre-commit hook.

mrchrisadams commented 5 years ago

Hey @arendjantetteroo , I'm not familiar enough with php to know the idiomatic way to do this, but the approach I see with phpunit, is that installing it with composer gives us ./bin/phpunit that we can call easily.

Do we have an equivalent for code style in php, like ./bin/some-handy-binary ?

If so, I'm thinking that, plus some read me instruction on how to set up pre-commit might be sufficient.

WDYT?

arendjantetteroo commented 5 years ago

php-cs-fixer is the name :)