Completed
Pull Request — master (#132)
by
unknown
08:35
created

PerformanceEventsResponse::setPerformanceEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Model;
4
5
use AppBundle\Entity\PerformanceEvent;
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 AppBundle\Model
14
 * @ExclusionPolicy("all")
15
 */
16
class PerformanceEventsResponse
17
{
18
    /**
19
     * @var PerformanceEvent[]
20
     *
21
     * @Type("array<AppBundle\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 PerformanceEvent[]
37
     */
38
    public function getPerformanceEvents()
39
    {
40
        return $this->performanceEvents;
41
    }
42
43
    /**
44
     * @param  mixed $performanceEvents
45
     * @return $this
46
     */
47
    public function setPerformanceEvents($performanceEvents)
48
    {
49
        $this->performanceEvents = $performanceEvents;
0 ignored issues
show
Documentation Bug introduced by
It seems like $performanceEvents of type * is incompatible with the declared type array<integer,object<App...tity\PerformanceEvent>> of property $performanceEvents.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return int
56
     */
57
    public function getCount()
58
    {
59
        return count($this->getPerformanceEvents());
60
    }
61
}
62