| Total Complexity | 3 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class RadioStyle |
||
| 6 | { |
||
| 7 | use ItemStyleTrait; |
||
| 8 | |||
| 9 | protected const DEFAULT_STYLES = [ |
||
| 10 | 'markerOn' => '[●] ', |
||
| 11 | 'markerOff' => '[○] ', |
||
| 12 | 'itemExtra' => '✔', |
||
| 13 | 'displaysExtra' => false, |
||
| 14 | ]; |
||
| 15 | |||
| 16 | public function __construct() |
||
| 17 | { |
||
| 18 | $this->setMarkerOn(self::DEFAULT_STYLES['markerOn']); |
||
| 19 | $this->setMarkerOff(self::DEFAULT_STYLES['markerOff']); |
||
| 20 | $this->setItemExtra(self::DEFAULT_STYLES['itemExtra']); |
||
| 21 | $this->setDisplaysExtra(self::DEFAULT_STYLES['displaysExtra']); |
||
| 22 | |||
| 23 | $this->custom = false; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function toArray() : array |
||
| 27 | { |
||
| 28 | return [ |
||
| 29 | 'markerOn' => $this->markerOn, |
||
| 30 | 'markerOff' => $this->markerOff, |
||
| 31 | 'itemExtra' => $this->itemExtra, |
||
| 32 | 'displaysExtra' => $this->displaysExtra, |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function fromArray(array $style) : self |
||
| 44 | } |
||
| 45 | } |
||
| 46 |