PerformanceEventsResponse::setPerformanceEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Model;
4
5
use App\Entity\Performance;
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 PerformanceEventsResponse
13
 * @package App\Model
14
 * @ExclusionPolicy("all")
15
 */
16
class PerformanceEventsResponse
17
{
18
    /**
19
     * @var Performance[]
20
     *
21
     * @Type("array<App\Entity\PerformanceEvent>")
22
     * @Expose
23
     */
24
    protected $performanceEvents;
25
26
    /**
27
     * @var int
28
     *
29
     * @Type("integer")
30
     * @Accessor(getter="getCount")
31
     * @Expose
32
     */
33
    protected $count;
34
35
    /**
36
     * @return Performance[]
37
     */
38 2
    public function getPerformanceEvents()
39
    {
40 2
        return $this->performanceEvents;
41
    }
42
43
    /**
44
     * @param  mixed $performanceEvents
45
     * @return $this
46
     */
47 2
    public function setPerformanceEvents($performanceEvents)
48
    {
49 2
        $this->performanceEvents = $performanceEvents;
50
51 2
        return $this;
52
    }
53
54
    /**
55
     * @return int
56
     */
57 2
    public function getCount()
58
    {
59 2
        return count($this->getPerformanceEvents());
60
    }
61
}
62