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

DeferredProcess   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 59
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
A getProcess() 0 4 1
A log() 0 4 1
A getLog() 0 4 1
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
    /**
15
     * @var Process
16
     */
17
    private $process;
18
19
    /**
20
     * @var LogMessage[]
21
     */
22
    private $log = [];
23
24
    /**
25
     * @param ProcessCommand $command
26
     * @param Process $process
27
     */
28
    public function __construct(ProcessCommand $command, Process $process)
29
    {
30
        $this->command = $command;
31
        $this->process = $process;
32
    }
33
34
    /**
35
     * @return ProcessCommand
36
     */
37
    public function getCommand(): ProcessCommand
38
    {
39
        return $this->command;
40
    }
41
42
    /**
43
     * @return Process
44
     */
45
    public function getProcess(): Process
46
    {
47
        return $this->process;
48
    }
49
50
    /**
51
     * @param LogMessage $logMessage
52
     */
53
    public function log(LogMessage $logMessage)
54
    {
55
        $this->log[] = $logMessage;
56
    }
57
58
    /**
59
     * @return LogMessage[]
60
     */
61
    public function getLog(): array
62
    {
63
        return $this->log;
64
    }
65
}
66