Automatic tests on the code are working well with phpstan.
phpstan is not only detecting errors, but also smaller problems. You can choose from level 0 up to level 8 and change how strict the checks should be.
On level 8 phpstan found 24 errors, keep in mind warnings and notices are all errors in phpstan.
To run phpstan locally you will need to follow these steps:
Install composer on your machine
Run composer init in your terminal and follow the steps in the terminal
Run composer require --dev phpstan/phpstan in terminal to add phpstan to your project with composer
Run vendor/bin/phpstan analyse src --level 0 in the terminal to test the code. As mentioned you can go up to level 8
The vendor folder created by composer is ignored by git.
You might need to tell composer your php.exe path. It is in xampp/php/php.exe
I also setup the main.yml to have automatic tests with github actions on every pull request to main or dev.
These are only general tests, if we want to we can write our own specialized tests later
Automatic tests on the code are working well with phpstan. phpstan is not only detecting errors, but also smaller problems. You can choose from level 0 up to level 8 and change how strict the checks should be.
On level 8 phpstan found 24 errors, keep in mind warnings and notices are all errors in phpstan.
To run phpstan locally you will need to follow these steps:
composer init
in your terminal and follow the steps in the terminalcomposer require --dev phpstan/phpstan
in terminal to add phpstan to your project with composervendor/bin/phpstan analyse src --level 0
in the terminal to test the code. As mentioned you can go up to level 8The vendor folder created by composer is ignored by git.
You might need to tell composer your php.exe path. It is in xampp/php/php.exe
I also setup the main.yml to have automatic tests with github actions on every pull request to main or dev.
These are only general tests, if we want to we can write our own specialized tests later