mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Test phpstan
This commit is contained in:
parent
76338116bf
commit
23b35492fd
|
|
@ -4,6 +4,14 @@ https://phpstan.org
|
|||
|
||||
PHPStan requires PHP >= 7.1
|
||||
|
||||
Install: composer require --dev phpstan/phpstan
|
||||
|
||||
Config File: phpstan.neon
|
||||
|
||||
Install:
|
||||
cd git
|
||||
mkdir phpstan
|
||||
cd phpstan
|
||||
composer require --dev phpstan/phpstan
|
||||
|
||||
Execute:
|
||||
cd git/dolibarr
|
||||
php8.2 ../phpstan/htdocs/includes/bin/phpstan -v analyze -a build/phpstan/bootstrap.php htdocs/commande/class -l0 --memory-limit 2G
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
<?php
|
||||
// Example to use PHPStan
|
||||
// cd git/dolibarr
|
||||
// /usr/bin/php7.2 /pathtophpstan/phpstan.phar -l1 analyze htdocs/societe/website.php --memory-limit 2G
|
||||
// /usr/bin/php7.2 /pathtophpstan/phpstan analyze htdocs/societe/website.php --memory-limit 2G
|
||||
|
||||
// Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things.
|
||||
define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
|
||||
define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ parameters:
|
|||
customRulesetUsed: true
|
||||
fileExtensions:
|
||||
- php
|
||||
excludePaths:
|
||||
- 'htdocs/build/*'
|
||||
- 'htdocs/dev/*'
|
||||
- 'htdocs/includes/*'
|
||||
- 'htdocs/install/doctemplates/*'
|
||||
- 'htdocs/langs/*'
|
||||
- 'htdocs/test/*'
|
||||
checkAlwaysTrueCheckTypeFunctionCall: false
|
||||
checkAlwaysTrueInstanceof: false
|
||||
checkAlwaysTrueStrictComparison: false
|
||||
|
|
@ -37,12 +44,10 @@ parameters:
|
|||
nodesByFileCountMax: 512
|
||||
nodesByStringCountMax: 512
|
||||
reportUnmatchedIgnoredErrors: true
|
||||
scopeClass: PHPStan\Analyser\Scope
|
||||
universalObjectCratesClasses:
|
||||
- stdClass
|
||||
- SimpleXMLElement
|
||||
earlyTerminatingMethodCalls: []
|
||||
memoryLimitFile: %tmpDir%/.memory_limit
|
||||
dynamicConstantNames:
|
||||
- ICONV_IMPL
|
||||
- PHP_VERSION
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user