Conditions | 5 |
Paths | 16 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
50 | 8 | public function toArray(): array |
|
51 | { |
||
52 | $request = [ |
||
53 | 8 | 'name' => $this->name, |
|
54 | 8 | 'type' => $this->type, |
|
55 | ]; |
||
56 | |||
57 | 8 | if ($this->description) { |
|
58 | 8 | $request['description'] = $this->description; |
|
59 | } |
||
60 | |||
61 | 8 | if ($this->category) { |
|
62 | 8 | $request['category'] = $this->category; |
|
63 | } |
||
64 | |||
65 | 8 | if ($this->imageUrl) { |
|
66 | 8 | $request['image_url'] = $this->imageUrl; |
|
67 | } |
||
68 | |||
69 | 8 | if ($this->homeUrl) { |
|
70 | 8 | $request['home_url'] = $this->homeUrl; |
|
71 | } |
||
72 | |||
73 | 8 | return $request; |
|
74 | } |
||
76 |