1 | <?php |
||
28 | class Message extends \Eloquent |
||
29 | { |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $primaryKey = 'id'; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $table = 'messages'; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $fillable = ['gitter_id', 'user_id', 'room_id', 'text', 'html', 'urls', 'created_at', 'updated_at']; |
||
44 | |||
45 | /** |
||
46 | * @param GitterMessage $gitter |
||
47 | * @return Message |
||
48 | */ |
||
49 | public static function createFromGitterMessage(GitterMessage $gitter) |
||
82 | |||
83 | /** |
||
84 | * @param Builder $builder |
||
85 | * @return $this |
||
86 | */ |
||
87 | public static function scopeOwn(Builder $builder) |
||
94 | |||
95 | /** |
||
96 | * @param Builder $builder |
||
97 | * @param Room|string $room |
||
98 | * @return $this |
||
99 | */ |
||
100 | public static function scopeForRoom(Builder $builder, $room) |
||
109 | |||
110 | /** |
||
111 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
112 | */ |
||
113 | public function mentions() |
||
117 | |||
118 | /** |
||
119 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
120 | */ |
||
121 | public function user() |
||
125 | |||
126 | /** |
||
127 | * @outputs |
||
128 | * @param $message |
||
129 | * @return mixed |
||
130 | */ |
||
131 | public function answer($message) |
||
149 | |||
150 | /** |
||
151 | * @param $content |
||
152 | * @return Text |
||
153 | */ |
||
154 | public function getTextAttribute($content) |
||
158 | |||
159 | /** |
||
160 | * @param array $urls |
||
161 | */ |
||
162 | public function setUrlsAttribute($urls = []) |
||
166 | |||
167 | /** |
||
168 | * @param $urls |
||
169 | * @return array|mixed |
||
170 | */ |
||
171 | public function getUrlsAttribute($urls) |
||
180 | } |
||
181 |
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.