dolibarr/dev/build/phpstan/README

27 lines
1.1 KiB
Text
Raw Permalink Normal View History

2025-01-05 13:28:07 +00:00
PHPStan (https://phpstan.org)
2023-08-06 09:56:31 +00:00
-----------------------------
2021-05-02 17:28:58 +00:00
PHPStan requires PHP >= 7.1
2023-08-06 09:56:31 +00:00
Config File is: ./phpstan.neon
2023-08-04 00:57:10 +00:00
= Installation =
cd ./dev/build/phpstan
mkdir phpstan
2023-08-04 00:57:10 +00:00
cd phpstan
composer require --dev phpstan/phpstan
= Build report from CLI =
In dolibarr/
mv htdocs/custom /tmp/
php dev/build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon -a dev/build/phpstan/bootstrap.php --memory-limit 4G --error-format=table htdocs/commande/class
php dev/build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon -a dev/build/phpstan/bootstrap.php --memory-limit 4G --error-format=table htdocs/
2023-08-04 01:42:46 +00:00
mv /tmp/custom htdocs
2023-08-06 09:56:31 +00:00
Build HTML report from Cron:
Example of line to add into a cron to generate a HTML report:
2025-01-05 15:30:56 +00:00
0 1 5 * * cd /home/dolibarr/preview.dolibarr.org/dolibarr; chmod -R u+w /home/dolibarr/preview.dolibarr.org/dolibarr; git reset --hard HEAD; git pull; /home/dolibarr/preview.dolibarr.org/dolibarr/dev/build/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/cti.dolibarr.org/phpstanindex.html