NewOutputEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A setNewOutput() 0 3 1
A getNewOutput() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusSchedulerPlugin\Event;
6
7
use Setono\SyliusSchedulerPlugin\Model\JobInterface;
8
9
class NewOutputEvent extends JobEvent
10
{
11
    public const TYPE_STDOUT = 1;
12
    public const TYPE_STDERR = 2;
13
14
    /**
15
     * @var string
16
     */
17
    private $newOutput;
18
19
    /**
20
     * @var int
21
     */
22
    private $type;
23
24
    /**
25
     * @param JobInterface $job
26
     * @param string $newOutput
27
     * @param int $type
28
     */
29
    public function __construct(JobInterface $job, string $newOutput, int $type = self::TYPE_STDOUT)
30
    {
31
        parent::__construct($job);
32
33
        $this->newOutput = $newOutput;
34
        $this->type = $type;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getNewOutput(): string
41
    {
42
        return $this->newOutput;
43
    }
44
45
    /**
46
     * @param string $output
47
     */
48
    public function setNewOutput(string $output): void
49
    {
50
        $this->newOutput = $output;
51
    }
52
53
    /**
54
     * @return int
55
     */
56
    public function getType(): int
57
    {
58
        return $this->type;
59
    }
60
}
61