| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 3 |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 74 | 21 | public function toArray() |
|
| 75 | { |
||
| 76 | |||
| 77 | 21 | $title = $this->title; |
|
| 78 | |||
| 79 | 21 | if (array_key_exists('title', $this->meta)) { |
|
| 80 | 18 | $title = $this->meta['title']; |
|
| 81 | 18 | } |
|
| 82 | 21 | if (count($this->images) < 1) { |
|
| 83 | 3 | $this->images[0] = null; |
|
| 84 | 3 | } |
|
| 85 | return [ |
||
| 86 | 21 | 'title' => $title, |
|
| 87 | 21 | 'images' => $this->images, |
|
| 88 | 21 | 'description' => $this->description, |
|
| 89 | 21 | 'url' => $this->url, |
|
| 90 | 21 | 'meta' => $this->meta, |
|
| 91 | 21 | 'media' => $this->media, |
|
| 92 | 21 | ]; |
|
| 93 | } |
||
| 94 | |||
| 103 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..