From 5ee6810c95f0290492d5bda1163bd9c5674018f9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 21 Apr 2023 12:39:05 +0100 Subject: [PATCH] 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. --- bin/build-configs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/build-configs b/bin/build-configs index d59e758..6f70bfe 100755 --- a/bin/build-configs +++ b/bin/build-configs @@ -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'))) {