-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathSymfonyProcessFactory.php
More file actions
44 lines (39 loc) · 1.46 KB
/
SymfonyProcessFactory.php
File metadata and controls
44 lines (39 loc) · 1.46 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*
* This file is part of the Webmozarts Console Parallelization package.
*
* (c) Webmozarts GmbH <office@webmozarts.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Webmozarts\Console\Parallelization\Process;
use Symfony\Component\Process\InputStream;
use Symfony\Component\Process\Process;
/**
* @phpstan-type ProcessOutput callable(positive-int|0, int|null, string, string): void
*/
interface SymfonyProcessFactory
{
/**
* Starts a single process reading from the given input stream.
*
* @param positive-int|0 $index Index of the process amoung the
* list of running processes.
* @param list<string> $command
* @param array<string, string>|null $environmentVariables
* @param ProcessOutput $processOutput A PHP callback which is run whenever
* there is some output available on
* STDOUT or STDERR.
*/
public function startProcess(
int $index,
InputStream $inputStream,
array $phpExecutable,
array $command,
string $workingDirectory,
?array $environmentVariables,
callable $processOutput
): Process;
}