| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | 1 | public function toArray() |
|
| 36 | { |
||
| 37 | 1 | $data = [ |
|
| 38 | 1 | 'type' => $this->getType(), |
|
| 39 | 1 | 'image_url' => $this->getUrl(), |
|
| 40 | 1 | 'alt_text' => $this->getAltText(), |
|
| 41 | ]; |
||
| 42 | |||
| 43 | 1 | if ($this->getTitle()) { |
|
| 44 | 1 | $data['title'] = $this->getTitle()->toArray(); |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | if ($this->getBlockId()) { |
|
| 48 | 1 | $data['block_id'] = $this->getBlockId(); |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | return $data; |
|
| 52 | } |
||
| 54 |