1 | <?php |
||
13 | abstract class Model extends BaseModel |
||
14 | { |
||
15 | use CassandraTypesTrait; |
||
16 | |||
17 | /** |
||
18 | * The connection name for the model. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $connection = 'cassandra'; |
||
23 | |||
24 | /** |
||
25 | * Indicates if the IDs are auto-incrementing. |
||
26 | * This is not possible in cassandra so we override this |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | public $incrementing = false; |
||
31 | |||
32 | /** |
||
33 | 55 | * @inheritdoc |
|
34 | */ |
||
35 | 55 | public function newEloquentBuilder($query) |
|
39 | |||
40 | /** |
||
41 | 55 | * @inheritdoc |
|
42 | */ |
||
43 | 55 | protected function newBaseQueryBuilder() |
|
49 | |||
50 | /** |
||
51 | 13 | * @inheritdoc |
|
52 | */ |
||
53 | 13 | public function freshTimestamp() |
|
57 | |||
58 | /** |
||
59 | 13 | * @inheritdoc |
|
60 | */ |
||
61 | public function fromDateTime($value) |
||
75 | |||
76 | /** |
||
77 | 6 | * @inheritdoc |
|
78 | */ |
||
79 | protected function asDateTime($value) |
||
88 | |||
89 | /** |
||
90 | * Get the table qualified key name. |
||
91 | * Cassandra does not support the table.column annotation so |
||
92 | * we override this |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getQualifiedKeyName() |
||
100 | |||
101 | /** |
||
102 | * Qualify the given column name by the model's table. |
||
103 | * |
||
104 | * @param string $column |
||
105 | * @return string |
||
106 | */ |
||
107 | public function qualifyColumn($column) |
||
111 | |||
112 | /** |
||
113 | 8 | * @inheritdoc |
|
114 | */ |
||
115 | 8 | public function __call($method, $parameters) |
|
124 | 2 | ||
125 | /** |
||
126 | 2 | * Create a new Eloquent Collection instance. |
|
127 | * |
||
128 | * @param Rows|array $rows |
||
129 | * |
||
130 | * @return Collection |
||
131 | * |
||
132 | * @throws \Exception |
||
133 | */ |
||
134 | public function newCassandraCollection($rows) |
||
153 | |||
154 | 14 | /** |
|
155 | * Determine if the new and old values for a given key are equivalent. |
||
156 | * |
||
157 | * @param string $key |
||
158 | * @param mixed $current |
||
159 | * @return bool |
||
160 | */ |
||
161 | 14 | public function originalIsEquivalent($key, $current) |
|
187 | |||
188 | /** |
||
189 | * Get the value of the model's primary key. |
||
190 | * |
||
191 | * @return mixed |
||
192 | 50 | */ |
|
193 | public function getKey() |
||
203 | 50 | ||
204 | } |
||
205 |
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.