Passed
Push — master ( 0235c3...d95c9b )
by Milroy
12:19
created

QueryStringParams::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiChef\RequestToEloquent;
6
7
use ApiChef\RequestQueryHelper\Fields;
8
use ApiChef\RequestQueryHelper\PaginationParams;
9
use ApiChef\RequestQueryHelper\QueryParamBag;
10
use ApiChef\RequestQueryHelper\Sorts;
11
use Illuminate\Http\Request;
12
13
class QueryStringParams
14
{
15
    public Fields $fields;
16
    public QueryParamBag $includes;
17
    public QueryParamBag $filters;
18
    public Sorts $sorts;
19
    public PaginationParams $paginationParams;
20
21
    public function __construct(Request $request)
22
    {
23
        $this->fields = $request->fields();
24
        $this->includes = $request->includes();
25
        $this->filters = $request->filters();
26
        $this->sorts = $request->sorts();
27
        $this->paginationParams = $request->paginationParams();
28
    }
29
}
30