Test Failed
Push — develop ( 01a8a8...14ce66 )
by Guilherme
65:10
created

DDC3579User::loadMetadata()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 17
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\Models\DDC3579;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\DBAL\Types\Type;
9
use Doctrine\ORM\Annotation as ORM;
10
use Doctrine\ORM\Mapping;
11
12
/**
13
 * @ORM\MappedSuperClass
14
 */
15
class DDC3579User
16
{
17
    /**
18
     * @ORM\Id
19
     * @ORM\GeneratedValue
20
     * @ORM\Column(type="integer", name="user_id", length=150)
21
     */
22
    protected $id;
23
24
    /**
25
     * @ORM\Column(name="user_name", nullable=true, unique=false, length=250)
26
     */
27
    protected $name;
28
29
    /**
30
     * @var ArrayCollection
31
     *
32
     * @ORM\ManyToMany(targetEntity="DDC3579Group")
33
     */
34
    protected $groups;
35
36
    /**
37
     * @param string $name
38
     */
39
    public function __construct($name = null)
40
    {
41
        $this->name     = $name;
42
        $this->groups   = new ArrayCollection;
43
    }
44
45
    /**
46
     * @return integer
47
     */
48
    public function getId()
49
    {
50
        return $this->id;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName()
57
    {
58
        return $this->name;
59
    }
60
61
    /**
62
     * @param string $name
63
     */
64
    public function setName($name)
65
    {
66
        $this->name = $name;
67
    }
68
69
    /**
70
     * @param DDC3579Group $group
71
     */
72
    public function addGroup(DDC3579Group $group)
73
    {
74
        $this->groups->add($group);
75
        $group->addUser($this);
0 ignored issues
show
Bug introduced by
The method addUser() does not seem to exist on object<Doctrine\Tests\Mo...s\DDC3579\DDC3579Group>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
76
    }
77
78
    /**
79
     * @return ArrayCollection
80
     */
81
    public function getGroups()
82
    {
83
        return $this->groups;
84
    }
85
}
86