| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function toArray() |
||
| 12 | { |
||
| 13 | return [ |
||
| 14 | 'id' => $this->id, |
||
|
|
|||
| 15 | 'title' => $this->title, |
||
| 16 | 'description' => $this->description, |
||
| 17 | 'user_id' => $this->user_id, |
||
| 18 | 'read' => $this->read ? true : false, |
||
| 19 | 'created_at' => $this->created_at.'', |
||
| 20 | 'updated_at' => $this->updated_at.'', |
||
| 21 | ]; |
||
| 22 | } |
||
| 23 | } |
||
| 24 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.