1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\Models\Cache; |
||
4 | |||
5 | use Doctrine\Common\Collections\ArrayCollection; |
||
6 | |||
7 | /** |
||
8 | * @Entity |
||
9 | * @Table("cache_action") |
||
10 | */ |
||
11 | class Action |
||
12 | { |
||
13 | /** |
||
14 | * @Id |
||
15 | * @Column(type="string") |
||
16 | * @GeneratedValue(strategy="NONE") |
||
17 | */ |
||
18 | public $name; |
||
19 | |||
20 | /** |
||
21 | * @OneToMany(targetEntity="Token", cascade={"persist", "remove"}, mappedBy="action") |
||
22 | */ |
||
23 | public $tokens; |
||
24 | |||
25 | public function __construct($name) |
||
26 | { |
||
27 | $this->name = $name; |
||
28 | $this->tokens = new ArrayCollection(); |
||
29 | } |
||
30 | |||
31 | public function addToken(Token $token) |
||
32 | { |
||
33 | $this->tokens[] = $token; |
||
34 | $token->action = $this; |
||
0 ignored issues
–
show
|
|||
35 | } |
||
36 | } |
||
37 |
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..