| Conditions | 4 |
| Paths | 3 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function updateCMSFields(FieldList $fields) |
||
| 10 | { |
||
| 11 | if ($this->owner->IsSubmitted()) { |
||
| 12 | $currentStep = $this->owner->MyStep()->Sort; |
||
| 13 | $securityStep = OrderStep::get()->filter(['ClassName' => 'OrderStep_SecurityCheck'])->first()->Sort; |
||
| 14 | if (! $this->owner->IsPaid() && $currentStep < $securityStep) { |
||
| 15 | $fields->addFieldsToTab( |
||
| 16 | 'Root.Next', |
||
| 17 | [ |
||
| 18 | HeaderField::create( |
||
| 19 | 'SkipToSecurityChecksHeader', |
||
| 20 | 'Skip To Security Checks' |
||
| 21 | ), |
||
| 22 | CheckboxField::create( |
||
| 23 | 'SkipToSecurityChecks', |
||
| 24 | 'Skip To Security Checks' |
||
| 25 | )->setDescription( |
||
| 26 | 'Ticking this checkbox will skip the payment step, allowing security checks to be conducted for orders that do not have successful payments.' |
||
| 27 | ) |
||
| 28 | ], |
||
| 29 | 'ActionNextStepManually' |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 52 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.