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 | 55 | /** |
|
34 | * @inheritdoc |
||
35 | 55 | */ |
|
36 | public function newEloquentBuilder($query) |
||
40 | |||
41 | 55 | /** |
|
42 | * @inheritdoc |
||
43 | 55 | */ |
|
44 | protected function newBaseQueryBuilder() |
||
50 | |||
51 | 13 | /** |
|
52 | * @inheritdoc |
||
53 | 13 | */ |
|
54 | public function freshTimestamp() |
||
58 | |||
59 | 13 | /** |
|
60 | * @inheritdoc |
||
61 | */ |
||
62 | 13 | public function fromDateTime($value) |
|
76 | |||
77 | 6 | /** |
|
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 | 8 | * |
|
114 | * @return string |
||
115 | 8 | */ |
|
116 | public function getQualifiedKeyName() |
||
120 | |||
121 | /** |
||
122 | * Qualify the given column name by the model's table. |
||
123 | * |
||
124 | 2 | * @param string $column |
|
125 | * @return string |
||
126 | 2 | */ |
|
127 | public function qualifyColumn($column) |
||
131 | |||
132 | /** |
||
133 | * Set a given attribute on the model. |
||
134 | * |
||
135 | * @param string $key |
||
136 | 14 | * @param mixed $value |
|
137 | * @return $this |
||
138 | */ |
||
139 | public function setAttribute($key, $value) |
||
172 | |||
173 | 55 | /** |
|
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 | 50 | * |
|
193 | * @throws \Exception |
||
194 | 50 | */ |
|
195 | 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 | 13 | * @param mixed $current |
|
220 | * @return bool |
||
221 | 13 | */ |
|
222 | 13 | public function originalIsEquivalent($key, $current) |
|
248 | |||
249 | /** |
||
250 | * Get the value of the model's primary key. |
||
251 | * |
||
252 | 17 | * @return mixed |
|
253 | */ |
||
254 | 17 | public function getKey() |
|
264 | 17 | ||
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.