feat: only create PHPStan file if it's set

Only create a `phpstan.neon.dist` file if the `php.phpstan` object is
set within the project's `build.yaml` file.
This commit is contained in:
Oliver Davies 2023-04-21 12:39:05 +01:00
parent 27ce1dc100
commit 5ee6810c95

View file

@ -171,13 +171,16 @@ function getFiles(array $configurationData): Collection
if (isPhp(Arr::get($configurationData, 'language'))) {
$filesToGenerate[] = new TemplateFile(data: 'php/Dockerfile', name: 'Dockerfile');
$filesToGenerate[] = new TemplateFile(data: 'php/phpcs.xml', name: 'phpcs.xml.dist');
$filesToGenerate[] = new TemplateFile(data: 'php/phpstan.neon', name: 'phpstan.neon.dist');
$filesToGenerate[] = new TemplateFile(data: 'php/phpunit.xml', name: 'phpunit.xml.dist');
$filesToGenerate[] = new TemplateFile(
data: 'php/docker-entrypoint-php',
name: 'docker-entrypoint-php',
path: 'tools/docker/images/php/root/usr/local/bin',
);
if (Arr::has(array: $configurationData, keys: 'php.phpstan')) {
$filesToGenerate[] = new TemplateFile(data: 'php/phpstan.neon', name: 'phpstan.neon.dist');
}
}
if (isNode(Arr::get($configurationData, 'language'))) {