New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correcting critical problems found by PHPStan #14290
Comments
Only PIWIK_* constants are in phpstan.php These are PHPStan Level 0 (of 0-7), later we can go higher. |
phpstan.neon # sed -e '16s#^#// #' -i plugins/ScheduledReports/config/tcpdf_config.php
parameters:
level: max
paths:
- %currentWorkingDirectory%/core/
#excludes_analyse:
autoload_files:
- %currentWorkingDirectory%/phpstan.php
- %currentWorkingDirectory%/libs/upgradephp/upgrade.php
#autoload_directories:
ignoreErrors:
- '#^PHPDoc tag @param#'
- '#^Access to an undefined property Piwik\\#' The two errors ignored above are very common, so it needs to be fixed First. phpstan.php <?php
if (!defined('PIWIK_DOCUMENT_ROOT')) {
define('PIWIK_DOCUMENT_ROOT', dirname(__FILE__) == '/' ? '' : dirname(__FILE__));
}
if (!defined('PIWIK_INCLUDE_PATH')) {
define('PIWIK_INCLUDE_PATH', PIWIK_DOCUMENT_ROOT);
}
if (!defined('PIWIK_PRINT_ERROR_BACKTRACE')) {
define('PIWIK_PRINT_ERROR_BACKTRACE', false);
}
if (!defined('PIWIK_VENDOR_PATH')) {
if (is_dir(PIWIK_INCLUDE_PATH . '/vendor')) {
define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/vendor');
} else {
define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/../..');
}
}
function disableEaccelerator() {} |
Feel free to create PRs for code improvements. As long as they are not too big, we are happy to review and merge them. |
Thank you for the instructions! |
Was going to say the same. If the PRs are small then we would review over the next weeks / months depending how many there are. In general we don't make changes to them just for the sake of an analysis tool unless you find a bug as it would be a time waster otherwise. Will close the issue and feel free to issue PRs |
Do you have time to review my PRs based on this report? I wouldn't like to be the 68th PR.
The text was updated successfully, but these errors were encountered: