1 | <?php |
||
15 | abstract class Model extends BaseModel |
||
16 | { |
||
17 | use CassandraTypesTrait; |
||
18 | |||
19 | /** |
||
20 | * The connection name for the model. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $connection = 'cassandra'; |
||
25 | |||
26 | /** |
||
27 | * Indicates if the IDs are auto-incrementing. |
||
28 | * This is not possible in cassandra so we override this |
||
29 | * |
||
30 | * @var bool |
||
31 | */ |
||
32 | public $incrementing = false; |
||
33 | |||
34 | /** |
||
35 | * The storage format of the model's time columns. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $timeFormat; |
||
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | 58 | public function newEloquentBuilder($query) |
|
48 | |||
49 | /** |
||
50 | * @inheritdoc |
||
51 | */ |
||
52 | 58 | protected function newBaseQueryBuilder() |
|
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | 13 | public function freshTimestamp() |
|
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | 13 | public function fromDateTime($value) |
|
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | 8 | protected function asDateTime($value) |
|
97 | |||
98 | /** |
||
99 | * Get the table qualified key name. |
||
100 | * Cassandra does not support the table.column annotation so |
||
101 | * we override this |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | 8 | public function getQualifiedKeyName() |
|
109 | |||
110 | /** |
||
111 | * Qualify the given column name by the model's table. |
||
112 | * |
||
113 | * @param string $column |
||
114 | * @return string |
||
115 | */ |
||
116 | 2 | public function qualifyColumn($column) |
|
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | */ |
||
124 | 58 | public function __call($method, $parameters) |
|
133 | |||
134 | /** |
||
135 | * Create a new Eloquent Collection instance. |
||
136 | * |
||
137 | * @param Rows|array $rows |
||
138 | * |
||
139 | * @return Collection |
||
140 | * |
||
141 | * @throws \Exception |
||
142 | */ |
||
143 | 53 | public function newCassandraCollection($rows) |
|
162 | |||
163 | /** |
||
164 | * Determine if the new and old values for a given key are equivalent. |
||
165 | * |
||
166 | * @param string $key |
||
167 | * @param mixed $current |
||
168 | * |
||
169 | * @return bool |
||
170 | * |
||
171 | * @throws \Exception |
||
172 | */ |
||
173 | 13 | public function originalIsEquivalent($key, $current) |
|
199 | |||
200 | /** |
||
201 | * Get the value of the model's primary key. |
||
202 | * |
||
203 | * @return mixed |
||
204 | */ |
||
205 | 16 | public function getKey() |
|
215 | |||
216 | /** |
||
217 | * Cast an attribute to a native PHP type. |
||
218 | * |
||
219 | * @param string $key |
||
220 | * @param mixed $value |
||
221 | * |
||
222 | * @return mixed |
||
223 | * |
||
224 | * @throws \Exception |
||
225 | */ |
||
226 | 3 | protected function castAttribute($key, $value) |
|
240 | |||
241 | /** |
||
242 | * Get the format for time stored in database. |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | 1 | public function getTimeFormat() |
|
250 | |||
251 | /** |
||
252 | * Get the format for time stored in database. |
||
253 | * |
||
254 | * @param string $format |
||
255 | * |
||
256 | * @return self |
||
257 | */ |
||
258 | public function setTimeFormat($format) |
||
264 | } |
||
265 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.