These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * NOTICE OF LICENSE |
||
5 | * |
||
6 | * Part of the Rinvex Repository Package. |
||
7 | * |
||
8 | * This source file is subject to The MIT License (MIT) |
||
9 | * that is bundled with this package in the LICENSE file. |
||
10 | * |
||
11 | * Package: Rinvex Repository Package |
||
12 | * License: The MIT License (MIT) |
||
13 | * Link: https://rinvex.com |
||
14 | */ |
||
15 | |||
16 | namespace Rinvex\Repository\Contracts; |
||
17 | |||
18 | use Illuminate\Contracts\Container\Container; |
||
19 | |||
20 | interface RepositoryContract |
||
21 | { |
||
22 | /** |
||
23 | * Set the IoC container instance. |
||
24 | * |
||
25 | * @param \Illuminate\Contracts\Container\Container $container |
||
26 | * |
||
27 | * @return $this |
||
28 | */ |
||
29 | public function setContainer(Container $container); |
||
30 | |||
31 | /** |
||
32 | * Get the IoC container instance or any of it's services. |
||
33 | * |
||
34 | * @param string|null $service |
||
35 | * |
||
36 | * @return object |
||
37 | */ |
||
38 | public function getContainer($service = null); |
||
39 | |||
40 | /** |
||
41 | * Set the repository identifier. |
||
42 | * |
||
43 | * @param string $repositoryId |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | public function setRepositoryId($repositoryId); |
||
48 | |||
49 | /** |
||
50 | * Get the repository identifier. |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | public function getRepositoryId(); |
||
55 | |||
56 | /** |
||
57 | * Set the repository model. |
||
58 | * |
||
59 | * @param string $model |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function setModel($model); |
||
64 | |||
65 | /** |
||
66 | * Get the repository model. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getModel(); |
||
71 | |||
72 | /** |
||
73 | * Create a new repository model instance. |
||
74 | * |
||
75 | * @throws \Rinvex\Repository\Exceptions\RepositoryException |
||
76 | * |
||
77 | * @return object |
||
78 | */ |
||
79 | public function createModel(); |
||
80 | |||
81 | /** |
||
82 | * Set the relationships that should be eager loaded. |
||
83 | * |
||
84 | * @param array $relations |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function with(array $relations); |
||
89 | |||
90 | /** |
||
91 | * Add a basic where clause to the query. |
||
92 | * |
||
93 | * @param string $attribute |
||
94 | * @param string $operator |
||
0 ignored issues
–
show
|
|||
95 | * @param mixed $value |
||
96 | * @param string $boolean |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function where($attribute, $operator = null, $value = null, $boolean = 'and'); |
||
101 | |||
102 | /** |
||
103 | * Add a "where in" clause to the query. |
||
104 | * |
||
105 | * @param string $attribute |
||
106 | * @param mixed $values |
||
107 | * @param string $boolean |
||
108 | * @param bool $not |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function whereIn($attribute, $values, $boolean = 'and', $not = false); |
||
113 | |||
114 | /** |
||
115 | * Add a "where not in" clause to the query. |
||
116 | * |
||
117 | * @param string $attribute |
||
118 | * @param mixed $values |
||
119 | * @param string $boolean |
||
120 | * |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function whereNotIn($attribute, $values, $boolean = 'and'); |
||
124 | |||
125 | /** |
||
126 | * Set the "offset" value of the query. |
||
127 | * |
||
128 | * @param int $offset |
||
129 | * |
||
130 | * @return $this |
||
131 | */ |
||
132 | public function offset($offset); |
||
133 | |||
134 | /** |
||
135 | * Set the "limit" value of the query. |
||
136 | * |
||
137 | * @param int $limit |
||
138 | * |
||
139 | * @return $this |
||
140 | */ |
||
141 | public function limit($limit); |
||
142 | |||
143 | /** |
||
144 | * Add an "order by" clause to the query. |
||
145 | * |
||
146 | * @param string $attribute |
||
147 | * @param string $direction |
||
148 | * |
||
149 | * @return $this |
||
150 | */ |
||
151 | public function orderBy($attribute, $direction = 'asc'); |
||
152 | |||
153 | /** |
||
154 | * Find an entity by it's primary key. |
||
155 | * |
||
156 | * @param int $id |
||
157 | * @param array $attributes |
||
158 | * |
||
159 | * @return object |
||
160 | */ |
||
161 | public function find($id, $attributes = ['*']); |
||
162 | |||
163 | /** |
||
164 | * Find an entity by one of it's attributes. |
||
165 | * |
||
166 | * @param string $attribute |
||
167 | * @param string $value |
||
168 | * @param array $attributes |
||
169 | * |
||
170 | * @return object |
||
171 | */ |
||
172 | public function findBy($attribute, $value, $attributes = ['*']); |
||
173 | |||
174 | /** |
||
175 | * Find all entities. |
||
176 | * |
||
177 | * @param array $attributes |
||
178 | * |
||
179 | * @return \Illuminate\Support\Collection |
||
180 | */ |
||
181 | public function findAll($attributes = ['*']); |
||
182 | |||
183 | /** |
||
184 | * Paginate all entities. |
||
185 | * |
||
186 | * @param int|null $perPage |
||
187 | * @param array $attributes |
||
188 | * @param string $pageName |
||
189 | * @param int|null $page |
||
190 | * |
||
191 | * @throws \InvalidArgumentException |
||
192 | * |
||
193 | * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
||
194 | */ |
||
195 | public function paginate($perPage = null, $attributes = ['*'], $pageName = 'page', $page = null); |
||
196 | |||
197 | /** |
||
198 | * Paginate all entities into a simple paginator. |
||
199 | * |
||
200 | * @param int|null $perPage |
||
201 | * @param array $attributes |
||
202 | * @param string $pageName |
||
203 | * |
||
204 | * @return \Illuminate\Contracts\Pagination\Paginator |
||
205 | */ |
||
206 | public function simplePaginate($perPage = null, $attributes = ['*'], $pageName = 'page'); |
||
207 | |||
208 | /** |
||
209 | * Find all entities matching where conditions. |
||
210 | * |
||
211 | * @param array $where |
||
212 | * @param array $attributes |
||
213 | * |
||
214 | * @return \Illuminate\Support\Collection |
||
215 | */ |
||
216 | public function findWhere(array $where, $attributes = ['*']); |
||
217 | |||
218 | /** |
||
219 | * Find all entities matching whereIn conditions. |
||
220 | * |
||
221 | * @param array $where |
||
222 | * @param array $attributes |
||
223 | * |
||
224 | * @return \Illuminate\Support\Collection |
||
225 | */ |
||
226 | public function findWhereIn(array $where, $attributes = ['*']); |
||
227 | |||
228 | /** |
||
229 | * Find all entities matching whereNotIn conditions. |
||
230 | * |
||
231 | * @param array $where |
||
232 | * @param array $attributes |
||
233 | * |
||
234 | * @return \Illuminate\Support\Collection |
||
235 | */ |
||
236 | public function findWhereNotIn(array $where, $attributes = ['*']); |
||
237 | |||
238 | /** |
||
239 | * Create a new entity with the given attributes. |
||
240 | * |
||
241 | * @param array $attributes |
||
242 | * |
||
243 | * @return array |
||
244 | */ |
||
245 | public function create(array $attributes = []); |
||
246 | |||
247 | /** |
||
248 | * Update an entity with the given attributes. |
||
249 | * |
||
250 | * @param mixed $id |
||
251 | * @param array $attributes |
||
252 | * |
||
253 | * @return array |
||
254 | */ |
||
255 | public function update($id, array $attributes = []); |
||
256 | |||
257 | /** |
||
258 | * Delete an entity with the given id. |
||
259 | * |
||
260 | * @param mixed $id |
||
261 | * |
||
262 | * @return array |
||
263 | */ |
||
264 | public function delete($id); |
||
265 | |||
266 | /** |
||
267 | * Dynamically pass missing static methods to the model. |
||
268 | * |
||
269 | * @param $method |
||
270 | * @param $parameters |
||
271 | * |
||
272 | * @return mixed |
||
273 | */ |
||
274 | public static function __callStatic($method, $parameters); |
||
275 | |||
276 | /** |
||
277 | * Dynamically pass missing methods to the model. |
||
278 | * |
||
279 | * @param string $method |
||
280 | * @param array $parameters |
||
281 | * |
||
282 | * @return mixed |
||
283 | */ |
||
284 | public function __call($method, $parameters); |
||
285 | } |
||
286 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.