Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function isValid($step) |
||
42 | { |
||
43 | if (false === $step instanceof Step) { |
||
44 | return; |
||
45 | } |
||
46 | |||
47 | if (false === $this->form->hasPersistence()) { |
||
48 | $this->addError( |
||
49 | 'In order to use steps, you first need to register at least one persistence service for this form.', |
||
50 | 1491828562 |
||
51 | ); |
||
52 | } else { |
||
53 | $defaultStep = $step->getSettings()->getDefaultStep(); |
||
54 | |||
55 | if (false === $step->hasStep($defaultStep)) { |
||
56 | $this->addError( |
||
57 | 'The step "%s" does not exist.', |
||
58 | 1491828813, |
||
59 | [$defaultStep] |
||
60 | ); |
||
61 | } |
||
62 | } |
||
63 | } |
||
64 | } |
||
65 |