1 | <?php |
||
22 | class ForumPost extends AbstractModel |
||
23 | { |
||
24 | public $table = 'forum_posts'; |
||
25 | |||
26 | public $fillable = ['title', 'body', 'forum_id', 'author_id', 'sticky', 'locked']; |
||
27 | |||
28 | /** |
||
29 | * Eloquent Relation. |
||
30 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
31 | */ |
||
32 | public function author() |
||
38 | |||
39 | /** |
||
40 | * Eloquent Relation. |
||
41 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
42 | */ |
||
43 | public function forum() |
||
47 | |||
48 | /** |
||
49 | * Eloquent Relation. |
||
50 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
51 | */ |
||
52 | public function replies() |
||
58 | |||
59 | /** |
||
60 | * Is model data valid. |
||
61 | * |
||
62 | * @param array|object $data The data to validate. |
||
63 | * |
||
64 | * @return boolean |
||
65 | */ |
||
66 | public static function valid($data) |
||
83 | |||
84 | /** |
||
85 | * Gets the last reply for the current forum post. |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | public function lastReply() |
||
108 | } |
||
109 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.