| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 19 | public function register() |
|
| 19 | { |
||
| 20 | 19 | QueryBuilder::macro('rapid_pagination', function () { |
|
| 21 | /* @var \Illuminate\Database\Query\Builder $this */ |
||
| 22 | 1 | return Paginator::create($this); |
|
|
|
|||
| 23 | 19 | }); |
|
| 24 | 19 | EloquentBuilder::macro('rapid_pagination', function () { |
|
| 25 | /* @var \Illuminate\Database\Eloquent\Builder $this */ |
||
| 26 | 17 | return Paginator::create($this); |
|
| 27 | 19 | }); |
|
| 28 | 19 | Relation::macro('rapid_pagination', function () { |
|
| 29 | /* @var \Illuminate\Database\Eloquent\Relations\Relation $this */ |
||
| 30 | 3 | return Paginator::create($this); |
|
| 31 | 19 | }); |
|
| 32 | } |
||
| 33 | |||
| 46 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: