PaginationServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 17 1
1
<?php
2
3
namespace Sulao\LRTS\Pagination;
4
5
use Illuminate\Pagination\LengthAwarePaginator as LaravelLengthAwarePaginator;
6
use Illuminate\Pagination\Paginator as LaravelPaginator;
7
use Sulao\LRTS\Helper;
8
9
class PaginationServiceProvider extends \Illuminate\Support\ServiceProvider
10
{
11
    /**
12
     * Register the application services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        LaravelPaginator::currentPathResolver(function () {
19
            return Helper::appendSlashes(
20
                $this->app['request']->url(),
21
                $this->app['request']->getPathInfo()
22
            );
23
        });
24
25
        $this->app->alias(
26
            LengthAwarePaginator::class,
27
            LaravelLengthAwarePaginator::class
28
        );
29
30
        $this->app->alias(
31
            Paginator::class,
32
            LaravelPaginator::class
33
        );
34
    }
35
}
36