Fix phpstan

This commit is contained in:
Laurent Destailleur 2023-08-04 03:24:41 +02:00
parent 23b35492fd
commit 2777857f5b
3 changed files with 9 additions and 5 deletions

View File

@ -14,4 +14,4 @@ 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
php8.2 ../phpstan/htdocs/includes/bin/phpstan -v analyze -a build/phpstan/bootstrap.php htdocs/commande/class -l0 --memory-limit 12G

View File

@ -1,10 +1,10 @@
<?php
// 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');
define('DOL_URL_ROOT', '/');
//define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
//define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
//define('DOL_URL_ROOT', '/');
// Load the main.inc.php file to have functions llx_Header and llx_Footer defined
// Load the main.inc.php file to have functions env defined
if (! defined("NOLOGIN")) define("NOLOGIN", '1');
global $conf, $langs, $user, $db;
include_once __DIR__ . '/../../htdocs/main.inc.php';

View File

@ -4,10 +4,14 @@ parameters:
- php
excludePaths:
- 'htdocs/build/*'
- 'htdocs/custom/*'
- 'htdocs/dev/*'
- 'htdocs/doc/*'
- 'htdocs/documents/*'
- 'htdocs/includes/*'
- 'htdocs/install/doctemplates/*'
- 'htdocs/langs/*'
- 'htdocs/support/*'
- 'htdocs/test/*'
checkAlwaysTrueCheckTypeFunctionCall: false
checkAlwaysTrueInstanceof: false