| Conditions | 3 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function boot() |
||
| 29 | { |
||
| 30 | Paginator::maker(function (...$args) { |
||
| 31 | return $this->app->make(Paginator::class, $args, true); |
||
| 32 | }); |
||
| 33 | |||
| 34 | Paginator::currentPathResolver(function () { |
||
| 35 | return $this->app->request->baseUrl(); |
||
| 36 | }); |
||
| 37 | |||
| 38 | Paginator::currentPageResolver(function ($varPage = 'page') { |
||
| 39 | |||
| 40 | $page = $this->app->request->param($varPage); |
||
| 41 | |||
| 42 | if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { |
||
| 43 | return (int) $page; |
||
| 44 | } |
||
| 45 | |||
| 46 | return 1; |
||
| 47 | }); |
||
| 50 |