Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 5 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return array |
||
57 | */ |
||
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, |
|
85 |