Add parameter for php version to static analysis command
[MAILPOET-3296]
This commit is contained in:
committed by
Veljko V
parent
dd3538b78d
commit
3845f400b1
@ -491,7 +491,7 @@ class RoboFile extends \Robo\Tasks {
|
||||
}
|
||||
}
|
||||
|
||||
public function qaPhpstan() {
|
||||
public function qaPhpstan(array $opts=['php-version' => null]) {
|
||||
$dir = __DIR__;
|
||||
$task = implode(' ', [
|
||||
'WP_ROOT="' . getenv('WP_ROOT') . '"',
|
||||
@ -499,6 +499,10 @@ class RoboFile extends \Robo\Tasks {
|
||||
"$dir/tasks/phpstan/vendor/bin/phpstan analyse ",
|
||||
]);
|
||||
|
||||
if ($opts['php-version'] !== null) {
|
||||
$task = "ANALYSIS_PHP_VERSION={$opts['php-version']} $task";
|
||||
}
|
||||
|
||||
// PHPStan must be run out of main plugin directory to avoid its autoloading
|
||||
// from vendor/autoload.php where some dev dependencies cause conflicts.
|
||||
return $this->collectionBuilder()
|
||||
|
Reference in New Issue
Block a user