Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
58 | 18 | public function toArray() |
|
59 | 3 | { |
|
60 | |||
61 | 18 | $title = $this->title; |
|
62 | 18 | if (array_key_exists('title', $this->meta)) { |
|
63 | 15 | $title = $this->meta['title']; |
|
64 | 15 | } |
|
65 | 18 | if (count($this->images) < 1) { |
|
66 | 3 | $this->images[0] = null; |
|
67 | 3 | } |
|
68 | return [ |
||
69 | 18 | 'title' => $title, |
|
70 | 18 | 'images' => $this->images, |
|
71 | 18 | 'description' => $this->description, |
|
72 | 18 | 'url' => $this->url, |
|
73 | 18 | 'meta' => $this->meta, |
|
74 | 18 | ]; |
|
75 | } |
||
76 | |||
85 |