1 | <?php |
||
10 | trait Pageable |
||
11 | { |
||
12 | /** |
||
13 | * Register a saved model event with the dispatcher. |
||
14 | * |
||
15 | * @param \Closure|string $callback |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | abstract public static function saved($callback); |
||
20 | |||
21 | /** |
||
22 | * Register a deleted model event with the dispatcher. |
||
23 | * |
||
24 | * @param \Closure|string $callback |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | abstract public static function deleted($callback); |
||
29 | |||
30 | /** |
||
31 | * Define a polymorphic many-to-many relationship. |
||
32 | * |
||
33 | * @param string $related |
||
34 | * @param string $name |
||
35 | * @param string $table |
||
|
|||
36 | * @param string $foreignPivotKey |
||
37 | * @param string $relatedPivotKey |
||
38 | * @param string $parentKey |
||
39 | * @param string $relatedKey |
||
40 | * @param bool $inverse |
||
41 | * |
||
42 | * @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
||
43 | */ |
||
44 | abstract public function morphToMany( |
||
54 | |||
55 | /** |
||
56 | * Get all attached pages to the model. |
||
57 | * |
||
58 | * @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
||
59 | */ |
||
60 | public function pages(): MorphToMany |
||
66 | |||
67 | /** |
||
68 | * Boot the pageable trait for the model. |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public static function bootPageable() |
||
78 | |||
79 | /** |
||
80 | * Attach the given page(s) to the model. |
||
81 | * |
||
82 | * @param mixed $pages |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | public function setPagesAttribute($pages): void |
||
92 | |||
93 | /** |
||
94 | * Scope query with all the given pages. |
||
95 | * |
||
96 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
97 | * @param mixed $pages |
||
98 | * |
||
99 | * @return \Illuminate\Database\Eloquent\Builder |
||
100 | */ |
||
101 | public function scopeWithAllPages(Builder $builder, $pages): Builder |
||
111 | |||
112 | /** |
||
113 | * Scope query with any of the given pages. |
||
114 | * |
||
115 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
116 | * @param mixed $pages |
||
117 | * |
||
118 | * @return \Illuminate\Database\Eloquent\Builder |
||
119 | */ |
||
120 | public function scopeWithAnyPages(Builder $builder, $pages): Builder |
||
126 | |||
127 | /** |
||
128 | * Scope query without any of the given pages. |
||
129 | * |
||
130 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
131 | * @param mixed $pages |
||
132 | * |
||
133 | * @return \Illuminate\Database\Eloquent\Builder |
||
134 | */ |
||
135 | public function scopeWithoutPages(Builder $builder, $pages): Builder |
||
141 | |||
142 | /** |
||
143 | * Scope query without any pages. |
||
144 | * |
||
145 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
146 | * |
||
147 | * @return \Illuminate\Database\Eloquent\Builder |
||
148 | */ |
||
149 | public function scopeWithoutAnyPages(Builder $builder): Builder |
||
153 | |||
154 | /** |
||
155 | * Determine if the model has any of the given pages. |
||
156 | * |
||
157 | * @param mixed $pages |
||
158 | * |
||
159 | * @return bool |
||
160 | */ |
||
161 | public function hasAnyPages($pages): bool |
||
165 | |||
166 | /** |
||
167 | * Determine if the model has all of the given pages. |
||
168 | * |
||
169 | * @param mixed $pages |
||
170 | * |
||
171 | * @return bool |
||
172 | */ |
||
173 | public function hasAllPages($pages): bool |
||
177 | |||
178 | /** |
||
179 | * Attach model pages. |
||
180 | * |
||
181 | * @param mixed $pages |
||
182 | * |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function attachPages($pages) |
||
192 | |||
193 | /** |
||
194 | * Sync model pages. |
||
195 | * |
||
196 | * @param mixed $pages |
||
197 | * @param bool $detaching |
||
198 | * |
||
199 | * @return $this |
||
200 | */ |
||
201 | public function syncPages($pages, bool $detaching = true) |
||
207 | |||
208 | /** |
||
209 | * Detach model pages. |
||
210 | * |
||
211 | * @param mixed $pages |
||
212 | * |
||
213 | * @return $this |
||
214 | */ |
||
215 | public function detachPages($pages = null) |
||
221 | } |
||
222 |
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.