|
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
|
|
|
* @var string |
|
38
|
|
|
* @Jms\Type("string") |
|
39
|
|
|
* @ORM\Column(type="string") |
|
40
|
|
|
*/ |
|
41
|
|
|
private $description = ''; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @var boolean |
|
45
|
|
|
* @Jms\Type("boolean") |
|
46
|
|
|
* @ORM\Column(type="boolean") |
|
47
|
|
|
*/ |
|
48
|
|
|
private $supplementary = false; |
|
49
|
|
|
|
|
50
|
11 |
|
public function __construct( |
|
51
|
|
|
string $identifier, |
|
52
|
|
|
Price $price, |
|
53
|
|
|
string $displayName, |
|
54
|
|
|
string $description = '', |
|
55
|
|
|
bool $supplementary = false |
|
56
|
|
|
) { |
|
57
|
11 |
|
$this->identifier = $identifier; |
|
58
|
11 |
|
$this->price = $price; |
|
|
|
|
|
|
59
|
11 |
|
$this->displayName = $displayName; |
|
60
|
11 |
|
$this->description = $description; |
|
61
|
11 |
|
$this->supplementary = $supplementary; |
|
62
|
11 |
|
} |
|
63
|
|
|
|
|
64
|
11 |
|
public function getIdentifier(): string |
|
65
|
|
|
{ |
|
66
|
11 |
|
return $this->identifier; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
16 |
|
public function getPrice(): Price |
|
70
|
|
|
{ |
|
71
|
16 |
|
return $this->price; |
|
|
|
|
|
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function getDisplayName(): string |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->displayName; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function getDescription(): string |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->description; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function isSupplementary(): bool |
|
85
|
|
|
{ |
|
86
|
|
|
return $this->supplementary; |
|
87
|
|
|
} |
|
88
|
|
|
} |
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..