Combine PHPStan config files into one

Before this commit, we had two different PHPStan configuration files. One
for the lib directory (phpstan.neon) and another one for the tests directory
(phpstan-tests.neon). This commit combines both files into one
(phpstan.neon) to make it easier to maintain and make changes to PHPStan
configurations.

As part of this process, it was necessary to change the Robo command
`./do qa:phpstan` to call PHPStan only once and to
combine php-version-dependent-config-tests.php and
php-version-dependent-config-libs.php in a new file called
php-version-dependent-config.php.

Another benefit of this change is that running PHPStan only once with a
single configuration file means that it runs about 20% faster than
the previous setup.

[MAILPOET-4024]
This commit is contained in:
Rodrigo Primo
2021-12-14 20:15:22 -03:00
committed by Veljko V
parent cb13830574
commit ec18076f71
5 changed files with 23 additions and 61 deletions

View File

@ -483,16 +483,10 @@ class RoboFile extends \Robo\Tasks {
// temp dir
->taskExec('mkdir -p ' . __DIR__ . '/temp')
->taskExec('rm -rf ' . __DIR__ . '/temp/phpstan')
// lib
->taskExec($task)
->arg("$dir/lib")
->dir(__DIR__ . '/tasks/phpstan')
// tests
->taskExec($task)
->rawArg('--configuration=phpstan-tests.neon')
->rawArg(
implode(' ', [
"$dir/lib",
"$dir/tests/_support",
"$dir/tests/DataFactories",
"$dir/tests/acceptance",
@ -501,7 +495,6 @@ class RoboFile extends \Robo\Tasks {
])
)
->dir(__DIR__ . '/tasks/phpstan')
->run();
}