Completed
Push — master ( be53ba...d8ac27 )
by Jan Philipp
11s
created

DeferredProcess::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
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 string
11
     */
12
    private $parsedCommand;
13
14
    /**
15
     * @var ProcessCommand
16
     */
17
    private $command;
18
19
    /**
20
     * @var Process
21
     */
22
    private $process;
23
24
    /**
25
     * @var LogMessage[]
26
     */
27
    private $log = [];
28
29
    /**
30
     * @param string $parsedCommand
31
     * @param ProcessCommand $command
32
     * @param Process $process
33
     */
34
    public function __construct(string $parsedCommand, ProcessCommand $command, Process $process)
35
    {
36
        $this->command = $command;
37
        $this->process = $process;
38
        $this->parsedCommand = $parsedCommand;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getParsedCommand(): string
45
    {
46
        return $this->parsedCommand;
47
    }
48
49
    /**
50
     * @return ProcessCommand
51
     */
52
    public function getCommand(): ProcessCommand
53
    {
54
        return $this->command;
55
    }
56
57
    /**
58
     * @return Process
59
     */
60
    public function getProcess(): Process
61
    {
62
        return $this->process;
63
    }
64
65
    /**
66
     * @param LogMessage $logMessage
67
     */
68
    public function log(LogMessage $logMessage)
69
    {
70
        $this->log[] = $logMessage;
71
    }
72
73
    /**
74
     * @return LogMessage[]
75
     */
76
    public function getLog(): array
77
    {
78
        return $this->log;
79
    }
80
}
81