Skip to content

Development Aids

Koen Teuwen edited this page Dec 29, 2021 · 22 revisions

To aid the development process, several development aids are included in the Makefile.

You can now use the following commands from the Makefile as well:

  • make phpcbf before committing to beautify your changes according to the PSR1 and PSR12 standards.
  • make phpcsfix to beatify all project code.
  • make phpcsfixrisky to beatify all project code and apply functional changes like typing. This may change functionality and/or introduce bugs. Use this with caution.
  • make phpstan to perform a static code analysis to find probable bugs.

On Linux or inside WSL, you can run

sudo apt install -y php-{cli,curl,gd,intl,imagick,mbstring,memcached,mysql,xml,pgsql,soap,zip,xdebug}

followed by php composer.phar install -o --ignore-platform-reqs

to circumvent Docker (which can be slow) and run the above mentioned commands natively (see the Makefile for the actual commands used).

Git hooks

If you want, you can run make phpcbf automatically when you commit by adding a git hook. You can easily do so by running

echo "make phpcbf" > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit