Files
piratepoet/mailpoet/tasks/phpstan/phpstan-baseline-fix-lib.php
Jan Lysý 1119e73056 Unify PHPStan baseline for PHP 8.0 and 8.1
Because both files were identical, I decided for simplification.
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00

18 lines
684 B
PHP

<?php declare(strict_types = 1);
$config = [];
$phpVersion = (int)getenv('ANALYSIS_PHP_VERSION') ?: PHP_VERSION_ID;
$config['parameters']['phpVersion'] = $phpVersion;
# PHPStan allows us to declare the currently reported list of errors as “the baseline” and cause it not being reported in subsequent runs.
# PHPStan will throw violations only in new and changed code.
# read more here: https://phpstan.org/user-guide/baseline
# we need to load different baseline file based on the php version
if ($phpVersion >= 70100 && $phpVersion < 80000) {
$config['includes'][] = 'phpstan-7-baseline.neon';
} else {
$config['includes'][] = 'phpstan-8-baseline.neon';
}
return $config;