diff --git a/src/Util/TemplateLinter.php b/src/Util/TemplateLinter.php index 311533288..e7b83287c 100644 --- a/src/Util/TemplateLinter.php +++ b/src/Util/TemplateLinter.php @@ -59,7 +59,11 @@ public function lintPhpTemplate(string|array $templateFilePath): void foreach ($templateFilePath as $filePath) { $cmdPrefix = $this->needsPhpCmdPrefix ? 'php ' : ''; - $process = Process::fromShellCommandline(sprintf('PHP_CS_FIXER_IGNORE_ENV=1 %s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath)); + if (str_contains(strtolower(\PHP_OS), 'win')) { + $process = Process::fromShellCommandline(sprintf('set PHP_CS_FIXER_IGNORE_ENV=1&%s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath)); + } else { + $process = Process::fromShellCommandline(sprintf('PHP_CS_FIXER_IGNORE_ENV=1 %s%s --config=%s --using-cache=no fix %s', $cmdPrefix, $this->phpCsFixerBinaryPath, $this->phpCsFixerConfigPath, $filePath)); + } $stat = $process->run();