Completed
Pull Request — master (#80)
by Jan Philipp
03:07 queued 01:30
created

DeferredProcess   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 51
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
     * @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