| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function toArray($request) |
||
| 17 | { |
||
| 18 | return [ |
||
| 19 | 'id' => $this->id, |
||
| 20 | 'url' => $this->url, |
||
| 21 | 'url_edit' => route('backend.posts.edit', $this), |
||
|
|
|||
| 22 | 'url_delete' => route('backend.posts.destroy', $this), |
||
| 23 | 'title' => Str::words($this->title, 5), |
||
| 24 | 'category' => $this->category->name, |
||
| 25 | 'tags' => $this->tags->take(3)->implode('name', ', '), |
||
| 26 | 'published_at' => $this->published_at->format('Y-m-d H:i'), |
||
| 27 | ]; |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: