Failed Conditions
Push — 2.7 ( c036c0...266f0d )
by Jonathan
57:23 queued 50:07
created

tests/Doctrine/Tests/Models/Cache/Action.php (1 issue)

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
Documentation Bug introduced by
It seems like $this of type Doctrine\Tests\Models\Cache\Action is incompatible with the declared type array of property $action.

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...
35
    }
36
}
37