| Conditions | 5 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function configureOptions(OptionsResolver $resolver, ActionConfiguration $actionConfiguration) |
||
| 20 | { |
||
| 21 | parent::configureOptions($resolver, $actionConfiguration); |
||
| 22 | |||
| 23 | |||
| 24 | $resolver |
||
| 25 | ->setDefault('class', '') |
||
| 26 | ->setNormalizer('class', function (Options $options, $value) { |
||
| 27 | if ($value) { |
||
| 28 | return $value; |
||
| 29 | } |
||
| 30 | $action = null; |
||
| 31 | |||
| 32 | if ($options->offsetGet('action')) { |
||
| 33 | $action = $options->offsetGet('action'); |
||
| 34 | } |
||
| 35 | |||
| 36 | if ('edit' === $action) { |
||
| 37 | return 'btn btn-primary'; |
||
| 38 | } |
||
| 39 | |||
| 40 | if ('delete' === $action) { |
||
| 41 | return 'btn btn-danger'; |
||
| 42 | } |
||
| 43 | |||
| 44 | return 'btn btn-secondary'; |
||
| 45 | }) |
||
| 49 |