dolibarr/build/phpstan
2025-01-03 19:55:25 +01:00
..
bootstrap_action.php fix phpstan 2024-12-16 14:21:32 +01:00
bootstrap.php add baseline exclude for phpstan (#31632) 2024-11-04 23:53:20 +01:00
phpstan-baseline.neon Merge remote-tracking branch 'upstream/develop' into fix_phpstan_2025_01_03 2025-01-03 19:55:25 +01:00
README Try to merge the 2 phpstan files 2024-01-14 19:42:54 +01:00

PHPStan (https://phpstan.org) 
-----------------------------

PHPStan requires PHP >= 7.1

Config File is: ./phpstan.neon

= Installation =

cd ./build/phpstan
mkdir phpstan
cd phpstan
composer require --dev phpstan/phpstan


= Build report from CLI =

In dolibarr/
mv htdocs/custom /tmp/
php build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon -a build/phpstan/bootstrap.php --memory-limit 4G --error-format=table htdocs/commande/class
php build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon -a build/phpstan/bootstrap.php --memory-limit 4G --error-format=table htdocs/
mv /tmp/custom htdocs

Build HTML report from Cron:
Example of line to add into a cron to generate a HTML report:
0 1 5 * * cd /home/dolibarr/preview.dolibarr.org/dolibarr; chmod -R u+w /home/dolibarr/preview.dolibarr.org/dolibarr; git pull; /home/dolibarr/phpstan/vendor/bin/phpstan -v analyze --memory-limit 4G --error-format=github | awk ' BEGIN{ print "Date "strftime("%Y-%m-%d")"<br>" } { print $0"<br>" } END{ print NR } ' > /home/dolibarr/doxygen.dolibarr.org/phpstan/index.html