diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index a39498ee3ae..e0a7d71b9b6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -55,7 +55,7 @@ jobs: # Run PHPStan - name: Run PHPStan - run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -c phpstan_action.neon | cs2pr --graceful-warnings + run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | cs2pr --graceful-warnings # continue-on-error: true # Save cache diff --git a/build/phpstan/README b/build/phpstan/README index 8acee2767f5..30f7a20b24e 100644 --- a/build/phpstan/README +++ b/build/phpstan/README @@ -17,8 +17,8 @@ composer require --dev phpstan/phpstan In dolibarr/ mv htdocs/custom /tmp/ -php build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon --memory-limit 4G --error-format=table htdocs/commande/class -php build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon --memory-limit 4G --error-format=table htdocs/ +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: diff --git a/phpstan.neon b/phpstan.neon index 8ed4c32664b..cc4562d57b2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,4 @@ parameters: - bootstrapFiles: - - build/phpstan/bootstrap.php tmpDir: ./.github/tmp parallel: jobSize: 20 @@ -18,14 +16,11 @@ parameters: excludePaths: analyseAndScan: - htdocs/custom/* - - htdocs/dev/* - - htdocs/doc/* - htdocs/documents/* - htdocs/install/doctemplates/* - htdocs/langs/* - htdocs/modulebuilder/template/test/* - htdocs/support/* - - htdocs/test/* analyse: - htdocs/includes/* checkAlwaysTrueCheckTypeFunctionCall: false diff --git a/phpstan_action.neon b/phpstan_action.neon deleted file mode 100644 index c54f2cf4b89..00000000000 --- a/phpstan_action.neon +++ /dev/null @@ -1,104 +0,0 @@ -parameters: - bootstrapFiles: - - build/phpstan/bootstrap_action.php - tmpDir: ./.github/tmp - parallel: - jobSize: 20 - processTimeout: 600.0 - maximumNumberOfProcesses: 8 - minimumNumberOfJobsPerProcess: 2 - buffer: 134217728 # 128 MB - customRulesetUsed: true - level: 2 - fileExtensions: - - php - paths: - - htdocs - - scripts - excludePaths: - analyseAndScan: - - htdocs/custom/* - - htdocs/documents/* - - htdocs/install/doctemplates/* - - htdocs/langs/* - - htdocs/modulebuilder/template/test/* - - htdocs/support/* - analyse: - - htdocs/includes/* - checkAlwaysTrueCheckTypeFunctionCall: false - checkAlwaysTrueInstanceof: false - checkAlwaysTrueStrictComparison: false - checkClassCaseSensitivity: false - checkFunctionArgumentTypes: false - checkFunctionNameCase: true - checkArgumentsPassedByReference: false - checkMaybeUndefinedVariables: false - checkNullables: false - checkThisOnly: true - checkUnionTypes: false - checkExplicitMixedMissingReturn: false - reportMaybes: false - reportMaybesInMethodSignatures: false - reportStaticMethodSignatures: false - polluteScopeWithLoopInitialAssignments: true - polluteScopeWithAlwaysIterableForeach: true - reportMagicMethods: false - reportMagicProperties: false - ignoreErrors: - - '#Result of function fieldList#' - - '#Caught class Stripe#' - - '#Function llx.* invoked with#' - - '#always exists and is not falsy#' - - '#is always fal#' - - '#always exists and is not nullable#' - - '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#' - - '#Sprain\\SwissQrBill\\#' - - '#Constructor of class .* has an unused parameter #' - - '#Default value of the parameter#' - internalErrorsCountLimit: 50 - cache: - nodesByFileCountMax: 512 - nodesByStringCountMax: 512 - reportUnmatchedIgnoredErrors: false - universalObjectCratesClasses: - - stdClass - - SimpleXMLElement - earlyTerminatingMethodCalls: [] - dynamicConstantNames: - - ICONV_IMPL - - PHP_VERSION - - PHP_MAJOR_VERSION - - PHP_MINOR_VERSION - - PHP_RELEASE_VERSION - - PHP_VERSION_ID - - PHP_EXTRA_VERSION - - PHP_ZTS - - PHP_DEBUG - - PHP_MAXPATHLEN - - PHP_OS - - PHP_OS_FAMILY - - PHP_SAPI - - PHP_EOL - - PHP_INT_MAX - - PHP_INT_MIN - - PHP_INT_SIZE - - PHP_FLOAT_DIG - - PHP_FLOAT_EPSILON - - PHP_FLOAT_MIN - - PHP_FLOAT_MAX - - DEFAULT_INCLUDE_PATH - - PEAR_INSTALL_DIR - - PEAR_EXTENSION_DIR - - PHP_EXTENSION_DIR - - PHP_PREFIX - - PHP_BINDIR - - PHP_BINARY - - PHP_MANDIR - - PHP_LIBDIR - - PHP_DATADIR - - PHP_SYSCONFDIR - - PHP_LOCALSTATEDIR - - PHP_CONFIG_FILE_PATH - - PHP_CONFIG_FILE_SCAN_DIR - - PHP_SHLIB_SUFFIX - - PHP_FD_SETSIZE