CollectionApiResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
namespace AppBundle\Response;
4
5
/**
6
 * @author Vehsamrak
7
 */
8
class CollectionApiResponse extends ApiResponse
9
{
10
11
    const DEFAULT_LIMIT = 50;
12
13
    /** @var int */
14
    private $total;
15
16
    /** @var int */
17
    private $limit;
18
19
    /** @var int */
20
    private $offset;
21
22 8
    public function __construct($data, int $httpCode, int $total, int $limit = 50, int $offset = 0)
23
    {
24 8
        parent::__construct($data, $httpCode);
25
26 8
        $this->total = $total;
27 8
        $this->limit = $limit ?: self::DEFAULT_LIMIT;
28 8
        $this->offset = $offset;
29 8
    }
30
}
31