| Conditions | 4 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 61 | 2 | public function toArray() |
|
| 62 | { |
||
| 63 | 2 | $data = [ |
|
| 64 | 2 | 'type' => $this->getType(), |
|
| 65 | 2 | 'action_id' => $this->getActionId(), |
|
| 66 | ]; |
||
| 67 | |||
| 68 | 2 | if ($this->getPlaceholder()) { |
|
| 69 | 2 | $data['placeholder'] = $this->getPlaceholder()->toArray(); |
|
| 70 | } |
||
| 71 | |||
| 72 | 2 | if ($this->getInitialValue()) { |
|
| 73 | 2 | $data[$this->getInitialValueField()] = $this->getInitialValue()->format($this->getInitialValueFormat()); |
|
| 74 | } |
||
| 75 | |||
| 76 | 2 | if ($this->getConfirm()) { |
|
| 77 | 2 | $data['confirm'] = $this->getConfirm()->toArray(); |
|
| 78 | } |
||
| 79 | |||
| 80 | 2 | return $data; |
|
| 81 | } |
||
| 83 |