Passed
Push — master ( 21a45d...334091 )
by Petr
03:48
created

AmbassadorMember   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 55
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A setShortDescription() 0 4 1
A setDescription() 0 4 1
1
<?php
2
3
namespace AppBundle\Entity\Infrasctucture;
4
5
use AppBundle\Entity\User;
6
use Doctrine\ORM\Mapping as ORM;
7
use JMS\Serializer\Annotation as Serializer;
8
9
/**
10
 * @author Vehsamrak
11
 * @ORM\MappedSuperclass
12
 */
13
abstract class AmbassadorMember
14
{
15
16
    use GetUserLoginTrait;
17
18
    /**
19
     * @ORM\Id
20
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
21
     * @ORM\JoinColumn(name="user_id", referencedColumnName="login")
22
     * @Serializer\Accessor("getUserLogin")
23
     * @Serializer\Type("string")
24
     * @Serializer\SerializedName("login")
25
     */
26
    protected $user;
27
28
    /**
29
     * @var string
30
     * @ORM\Column(name="short_description", type="text", nullable=false)
31
     * @Serializer\SerializedName("short_description")
32
     */
33
    protected $shortDescription;
34
35
    /**
36
     * @var string
37
     * @ORM\Column(name="description", type="text", nullable=true)
38
     */
39
    protected $description;
40
41
    /**
42
     * @var Ambassador
43
     */
44
    protected $ambassador;
45
46 5
    public function __construct(
47
        Ambassador $ambassador,
48
        User $user,
49
        string $shortDescription = '',
50
        string $description = null
51
    ) {
52 5
        $this->user = $user;
53 5
        $this->ambassador = $ambassador;
54 5
        $this->shortDescription = $shortDescription;
55 5
        $this->description = $description;
56 5
    }
57
58 1
    public function setShortDescription(string $shortDescription)
59
    {
60 1
        $this->shortDescription = $shortDescription;
61 1
    }
62
63 1
    public function setDescription(string $description)
64
    {
65 1
        $this->description = $description;
66 1
    }
67
}
68