-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathConfigHelper.php
More file actions
29 lines (25 loc) · 803 Bytes
/
ConfigHelper.php
File metadata and controls
29 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace Padam87\RasterizeBundle;
use Symfony\Component\Process\InputStream;
use Symfony\Component\Process\Process;
class ConfigHelper
{
public function __construct(private string $projectDir, private array $config)
{
}
public function buildProcess(InputStream $input, array $arguments = [], array $env = []): Process
{
return new Process(
array_merge(
[
$this->config['script']['callable'],
$this->projectDir . DIRECTORY_SEPARATOR . $this->config['script']['path']
],
array_values(array_merge($this->config['arguments'], $arguments))
),
null,
array_merge($this->config['env_vars'], $env),
$input
);
}
}