Completed
Pull Request — master (#191)
by Serhii
02:32
created

EmployeesResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 45
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
1
<?php
2
3
namespace App\Model;
4
5
use App\Entity\Employee;
6
use JMS\Serializer\Annotation\Accessor;
7
use JMS\Serializer\Annotation\ExclusionPolicy;
8
use JMS\Serializer\Annotation\Expose;
9
use JMS\Serializer\Annotation\Type;
10
11
/**
12
 * Class EmployeesResponse
13
 * @package App\Model
14
 * @ExclusionPolicy("all")
15
 */
16
class EmployeesResponse extends AbstractPaginatedModel
17
{
18
    /**
19
     * @var Employee[]
20
     * @Type("array<App\Entity\Employee>")
21
     * @Expose
22
     */
23
    public $employees;
24
25
    /**
26
     * @Type("integer")
27
     * @Accessor(getter="getCount")
28
     * @Expose
29
     */
30
    public int $count;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
31
32
    /**
33
     * @Type("integer")
34
     * @Expose
35
     */
36
    public int $currentPage;
37 2
38
    /**
39 2
     * @Type("integer")
40
     * @Expose
41
     */
42
    public int $overAllCount;
43
44
    /**
45
     * @Type("integer")
46 2
     * @Expose
47
     */
48 2
    public int $seed;
49
50 2
    /**
51
     * @Type("bool")
52
     * @Expose
53
     */
54
    public bool $rand;
55
56 2
    public function getCount(): int
57
    {
58 2
        return count($this->employees);
59
    }
60
}
61