1 | <?php |
||
9 | class EloquentRepository |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $model; |
||
13 | |||
14 | /** |
||
15 | * @todo get default orders from model's primaryKey. |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $orders = [ |
||
19 | 'id' => false, |
||
20 | ]; |
||
21 | |||
22 | /** @var array */ |
||
23 | protected $cached = []; |
||
24 | |||
25 | /** @var bool */ |
||
26 | protected $cacheEnabled = true; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function countAll() |
||
35 | |||
36 | /** |
||
37 | * @todo data filter |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function insertItems(array $items) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function findItems(array $where) |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function getAllItems() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function getItem($id) |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function getItemsById(array $arrayOfId) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function updateItem($id, array $dataSet) |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function createItem(array $dataSet) |
||
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | public function deleteItem($id) |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | public function cacheItem(Model $item) |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function cacheItems(Collection $items) |
||
156 | |||
157 | /** |
||
158 | * {@inheritdoc} |
||
159 | */ |
||
160 | public function flushItem($id) |
||
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | public function flushAllItems() |
||
172 | |||
173 | /** |
||
174 | * {@inheritdoc} |
||
175 | */ |
||
176 | public function cacheEnable($cacheEnabled = true) |
||
182 | |||
183 | /** |
||
184 | * @param array $dataSet |
||
185 | * @return array |
||
186 | */ |
||
187 | public function filterDataSet(array $dataSet) |
||
191 | |||
192 | /** |
||
193 | * @param array $where |
||
194 | * @return array |
||
195 | */ |
||
196 | public function filterWhere(array $where) |
||
200 | |||
201 | /** |
||
202 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
203 | * @param bool $reversed |
||
204 | * @return \Illuminate\Database\Eloquent\Builder |
||
205 | */ |
||
206 | protected function applyScopeOrders(Builder $query, $reversed = false) |
||
213 | |||
214 | /** |
||
215 | * @return string |
||
216 | */ |
||
217 | protected function getKeyName() |
||
225 | |||
226 | /** |
||
227 | * @return \Illuminate\Database\Eloquent\Builder |
||
228 | */ |
||
229 | protected function createQuery() |
||
233 | |||
234 | /** |
||
235 | * @return \Illuminate\Database\Eloquent\Model |
||
236 | */ |
||
237 | protected function createModel() |
||
242 | |||
243 | /** |
||
244 | * @return string |
||
245 | */ |
||
246 | protected function getAttributeModel() |
||
253 | } |
||
254 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.