1 | <?php |
||
16 | class SubstepFetchingMiddleware extends AbstractMiddleware implements After, FormInjectionSignal, PresetMiddlewareInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var int |
||
20 | */ |
||
21 | protected $priority = self::PRIORITY_STEP_FETCHING + 150; |
||
22 | |||
23 | /** |
||
24 | * @var Step |
||
25 | */ |
||
26 | protected $currentStep; |
||
27 | |||
28 | /** |
||
29 | * @var StepMiddlewareService |
||
30 | */ |
||
31 | protected $service; |
||
32 | |||
33 | /** |
||
34 | * @var FormObjectSteps |
||
35 | */ |
||
36 | protected $stepService; |
||
37 | |||
38 | /** |
||
39 | * Inject the step service. |
||
40 | */ |
||
41 | public function initializeMiddleware() |
||
45 | |||
46 | /** |
||
47 | * @param Arguments $arguments |
||
48 | */ |
||
49 | public function after(Arguments $arguments) |
||
73 | |||
74 | /** |
||
75 | * Fetches the current substep that should be displayed (the first |
||
76 | * substep(s) may have an activation condition). |
||
77 | */ |
||
78 | private function fetchCurrentSubstep() |
||
86 | } |
||
87 |
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: