NewOutputEvent::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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