1 | <?php |
||
15 | class Pipeline |
||
16 | { |
||
17 | /** @var EventDispatcherInterface */ |
||
18 | private $dispatcher; |
||
19 | |||
20 | /** @var AbstractParaunitProcess|null */ |
||
21 | private $process; |
||
22 | |||
23 | /** @var int */ |
||
24 | private $number; |
||
25 | |||
26 | /** |
||
27 | * Pipeline constructor. |
||
28 | * @param EventDispatcherInterface $dispatcher |
||
29 | * @param int $number |
||
30 | */ |
||
31 | 48 | public function __construct(EventDispatcherInterface $dispatcher, int $number) |
|
36 | |||
37 | 29 | public function execute(AbstractParaunitProcess $process) |
|
48 | |||
49 | 30 | public function isFree(): bool |
|
53 | |||
54 | 3 | public function isTerminated(): bool |
|
62 | |||
63 | 25 | public function triggerTermination(): bool |
|
77 | |||
78 | 2 | public function getNumber(): int |
|
82 | |||
83 | 25 | private function handleProcessTermination() |
|
88 | } |
||
89 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: