Skip to content

Commit e535fdc

Browse files
committed
Make compatible with PHP versions older then 7.4
1 parent 4b0f02a commit e535fdc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Css/PreProcessor/Adapter/Less/Processor.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,22 @@ public function processContent(AssetFile $asset)
9494
*/
9595
protected function compileFile($filePath)
9696
{
97-
$process = new Process([
98-
$this->getPathToNodeBinary(),
99-
...$this->getNodeArgsAsArray(),
100-
$this->getPathToLessCompiler(),
101-
...$this->getCompilerArgsAsArray(),
102-
$filePath,
103-
]);
97+
$nodeCmdArgs = $this->getNodeArgsAsArray();
98+
$lessCmdArgs = $this->getCompilerArgsAsArray();
10499

100+
$command = [];
101+
$command[] = $this->getPathToNodeBinary();
102+
$command = array_merge($command, $nodeCmdArgs);
103+
$command[] = $this->getPathToLessCompiler();
104+
$command = array_merge($command, $lessCmdArgs);
105+
$command[] = $filePath;
106+
107+
$process = new Process($command);
105108
$process->run();
106109

107110
if (!$process->isSuccessful()) {
108111
$error = sprintf(
109-
'The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s",
112+
'The command "%s" failed.' . "\n\nExit Code: %s(%s)\n\nWorking directory: %s",
110113
$process->getCommandLine(),
111114
$process->getExitCode(),
112115
$process->getExitCodeText(),

0 commit comments

Comments
 (0)