Completed
Pull Request — master (#80)
by Jan Philipp
01:46
created

DeferredProcess::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Psh\ScriptRuntime;
4
5
use Symfony\Component\Process\Process;
6
7
class DeferredProcess
8
{
9
    /**
10
     * @var ProcessCommand
11
     */
12
    private $command;
13
    /**
14
     * @var Process
15
     */
16
    private $process;
17
18
    /**
19
     * @var LogMessage[]
20
     */
21
    private $log = [];
22
23
    public function __construct(ProcessCommand $command, Process $process)
24
    {
25
        $this->command = $command;
26
        $this->process = $process;
27
    }
28
29
    /**
30
     * @return ProcessCommand
31
     */
32
    public function getCommand(): ProcessCommand
33
    {
34
        return $this->command;
35
    }
36
37
    /**
38
     * @return Process
39
     */
40
    public function getProcess(): Process
41
    {
42
        return $this->process;
43
    }
44
45
    public function log(LogMessage $logMessage)
46
    {
47
        $this->log[] = $logMessage;
48
    }
49
50
    /**
51
     * @return LogMessage[]
52
     */
53
    public function getLog(): array
54
    {
55
        return $this->log;
56
    }
57
}
58