| 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 |
||
| 75 | 18 | public function toArray() |
|
| 76 | { |
||
| 77 | |||
| 78 | 18 | $title = $this->title; |
|
| 79 | |||
| 80 | 18 | if (array_key_exists('title', $this->meta)) { |
|
| 81 | 15 | $title = $this->meta['title']; |
|
| 82 | 15 | } |
|
| 83 | 18 | if (count($this->images) < 1) { |
|
| 84 | 3 | $this->images[0] = null; |
|
| 85 | 3 | } |
|
| 86 | return [ |
||
| 87 | 18 | 'title' => $title, |
|
| 88 | 18 | 'images' => $this->images, |
|
| 89 | 18 | 'description' => $this->description, |
|
| 90 | 18 | 'url' => $this->url, |
|
| 91 | 18 | 'meta' => $this->meta, |
|
| 92 | 18 | 'media' => $this->media, |
|
| 93 | 18 | ]; |
|
| 94 | } |
||
| 95 | |||
| 104 |
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..