Total Complexity | 8 |
Total Lines | 103 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Start extends Event |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var Queue |
||
19 | */ |
||
20 | private $queue; |
||
21 | |||
22 | /** |
||
23 | * @var Context |
||
24 | */ |
||
25 | private $context; |
||
26 | |||
27 | /** |
||
28 | * @var float |
||
29 | */ |
||
30 | private $startTime; |
||
31 | |||
32 | /** |
||
33 | * @var boolean |
||
34 | */ |
||
35 | private $executionInterrupted; |
||
36 | |||
37 | /** |
||
38 | * @var integer |
||
39 | */ |
||
40 | private $exitStatus; |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | public static function name(): string |
||
46 | { |
||
47 | return 'consumer.event.start'; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Constructor. |
||
52 | * |
||
53 | * @param Queue $queue |
||
54 | * @param Context $context |
||
55 | * @param float $startTime |
||
56 | */ |
||
57 | public function __construct( |
||
58 | Queue $queue, |
||
59 | Context $context, |
||
60 | float $startTime |
||
61 | ) { |
||
62 | $this->queue = $queue; |
||
63 | $this->context = $context; |
||
64 | $this->startTime = $startTime; |
||
65 | $this->executionInterrupted = false; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return Queue |
||
70 | */ |
||
71 | public function queue(): Queue |
||
72 | { |
||
73 | return $this->queue; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return Context |
||
78 | */ |
||
79 | public function context(): Context |
||
80 | { |
||
81 | return $this->context; |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @return float |
||
86 | */ |
||
87 | public function startTime(): float |
||
88 | { |
||
89 | return $this->startTime; |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * @return int|null |
||
94 | */ |
||
95 | public function exitStatus(): ?int |
||
96 | { |
||
97 | return $this->exitStatus; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function isExecutionInterrupted(): bool |
||
104 | { |
||
105 | return $this->executionInterrupted; |
||
106 | } |
||
107 | |||
108 | /** |
||
109 | * @param int|null $exitStatus |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | public function interruptExecution(?int $exitStatus = null): void |
||
117 | } |
||
118 | |||
119 | } |
||
120 |