Passed
Push — master ( c541cb...64a56e )
by Chris
33s
created

TicketType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
dl 0
loc 60
rs 10
c 0
b 0
f 0
ccs 9
cts 11
cp 0.8182
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getIdentifier() 0 4 1
A getPrice() 0 4 1
A getDisplayName() 0 4 1
1
<?php
2
3
namespace ConferenceTools\Tickets\Domain\ValueObject;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use JMS\Serializer\Annotation as Jms;
7
8
/**
9
 * Class TicketType
10
 * @package ConferenceTools\Tickets\Domain\ValueObject
11
 * @ORM\Embeddable
12
 */
13
final class TicketType
14
{
15
    /**
16
     * @var string
17
     * @Jms\Type("string")
18
     * @ORM\Column(type="string")
19
     */
20
    private $identifier;
21
22
    /**
23
     * @var Money
24
     * @ORM\Embedded(class="ConferenceTools\Tickets\Domain\ValueObject\Price")
25
     * @Jms\Type("ConferenceTools\Tickets\Domain\ValueObject\Price")
26
     */
27
    private $price;
28
29
    /**
30
     * @var string
31
     * @Jms\Type("string")
32
     * @ORM\Column(type="string")
33
     */
34
    private $displayName;
35
36
    /**
37
     * TicketType constructor.
38
     * @param string $identifier
39
     * @param Price $price
40
     * @param string $displayName
41
     */
42 11
    public function __construct(string $identifier, Price $price, string $displayName)
43
    {
44 11
        $this->identifier = $identifier;
45 11
        $this->price = $price;
0 ignored issues
show
Documentation Bug introduced by
It seems like $price of type object<ConferenceTools\T...main\ValueObject\Price> is incompatible with the declared type object<ConferenceTools\T...main\ValueObject\Money> of property $price.

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...
46 11
        $this->displayName = $displayName;
47 11
    }
48
49
    /**
50
     * @return string
51
     */
52 5
    public function getIdentifier(): string
53
    {
54 5
        return $this->identifier;
55
    }
56
57
    /**
58
     * @return Price
59
     */
60 7
    public function getPrice(): Price
61
    {
62 7
        return $this->price;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getDisplayName(): string 
69
    {
70
        return $this->displayName;
71
    }
72
}