Passed
Push — master ( 5f39d8...1dccda )
by Kevin
02:49
created

Contact::setAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Fixtures\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\Table(name="contacts")
10
 */
11
class Contact
12
{
13
    /**
14
     * @ORM\Id
15
     * @ORM\GeneratedValue
16
     * @ORM\Column(type="integer")
17
     */
18
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
19
20
    /**
21
     * @ORM\Column(type="string")
22
     */
23
    private $name;
24
25
    /**
26
     * @ORM\Embedded("Address")
27
     */
28
    private $address;
29
30
    public function __construct($name)
31
    {
32
        $this->name = $name;
33
        $this->address = new Address();
34
    }
35
36
    public function getName()
37
    {
38
        return $this->name;
39
    }
40
41
    public function getAddress(): Address
42
    {
43
        return $this->address;
44
    }
45
46
    public function setAddress(Address $address): void
47
    {
48
        $this->address = $address;
49
    }
50
}
51