1 | <?php |
||
14 | abstract class Model extends BaseModel |
||
15 | { |
||
16 | use CassandraTypesTrait; |
||
17 | |||
18 | /** |
||
19 | * The connection name for the model. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $connection = 'cassandra'; |
||
24 | |||
25 | /** |
||
26 | * Indicates if the IDs are auto-incrementing. |
||
27 | * This is not possible in cassandra so we override this |
||
28 | * |
||
29 | * @var bool |
||
30 | */ |
||
31 | public $incrementing = false; |
||
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | */ |
||
36 | 55 | public function newEloquentBuilder($query) |
|
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | 55 | protected function newBaseQueryBuilder() |
|
50 | |||
51 | /** |
||
52 | * @inheritdoc |
||
53 | */ |
||
54 | 13 | public function freshTimestamp() |
|
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | 13 | public function fromDateTime($value) |
|
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | 6 | protected function asDateTime($value) |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | protected function originalIsNumericallyEquivalent($key) |
||
108 | |||
109 | /** |
||
110 | * Get the table qualified key name. |
||
111 | * Cassandra does not support the table.column annotation so |
||
112 | * we override this |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | 8 | public function getQualifiedKeyName() |
|
120 | |||
121 | /** |
||
122 | * Qualify the given column name by the model's table. |
||
123 | * |
||
124 | * @param string $column |
||
125 | * @return string |
||
126 | */ |
||
127 | 2 | public function qualifyColumn($column) |
|
131 | |||
132 | /** |
||
133 | * Set a given attribute on the model. |
||
134 | * |
||
135 | * @param string $key |
||
136 | * @param mixed $value |
||
137 | * @return $this |
||
138 | */ |
||
139 | 14 | public function setAttribute($key, $value) |
|
172 | |||
173 | /** |
||
174 | * @inheritdoc |
||
175 | */ |
||
176 | 55 | public function __call($method, $parameters) |
|
185 | |||
186 | /** |
||
187 | * Create a new Eloquent Collection instance. |
||
188 | * |
||
189 | * @param Rows|array $rows |
||
190 | * |
||
191 | * @return Collection |
||
192 | * |
||
193 | * @throws \Exception |
||
194 | */ |
||
195 | 50 | public function newCassandraCollection($rows) |
|
214 | |||
215 | /** |
||
216 | * Determine if the new and old values for a given key are equivalent. |
||
217 | * |
||
218 | * @param string $key |
||
219 | * @param mixed $current |
||
220 | * @return bool |
||
221 | */ |
||
222 | 13 | public function originalIsEquivalent($key, $current) |
|
248 | |||
249 | /** |
||
250 | * Get the value of the model's primary key. |
||
251 | * |
||
252 | * @return mixed |
||
253 | */ |
||
254 | 16 | public function getKey() |
|
264 | |||
265 | } |
||
266 |
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.