|
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 Delegate |
|
10
|
|
|
* @package ConferenceTools\Tickets\Domain\ValueObject |
|
11
|
|
|
* @ORM\Embeddable() |
|
12
|
|
|
*/ |
|
13
|
|
|
class Delegate |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* @var string |
|
17
|
|
|
* @ORM\Column(type="string") |
|
18
|
|
|
* @JMS\Type("string") |
|
19
|
|
|
*/ |
|
20
|
|
|
private $firstname; |
|
21
|
|
|
/** |
|
22
|
|
|
* @var string |
|
23
|
|
|
* @ORM\Column(type="string") |
|
24
|
|
|
* @JMS\Type("string") |
|
25
|
|
|
*/ |
|
26
|
|
|
private $lastname; |
|
27
|
|
|
/** |
|
28
|
|
|
* @var string |
|
29
|
|
|
* @ORM\Column(type="string") |
|
30
|
|
|
* @JMS\Type("string") |
|
31
|
|
|
*/ |
|
32
|
|
|
private $email; |
|
33
|
|
|
/** |
|
34
|
|
|
* @var string |
|
35
|
|
|
* @ORM\Column(type="string") |
|
36
|
|
|
* @JMS\Type("string") |
|
37
|
|
|
*/ |
|
38
|
|
|
private $company; |
|
39
|
|
|
/** |
|
40
|
|
|
* @var string |
|
41
|
|
|
* @ORM\Column(type="string") |
|
42
|
|
|
* @JMS\Type("string") |
|
43
|
|
|
*/ |
|
44
|
|
|
private $twitter; |
|
45
|
|
|
/** |
|
46
|
|
|
* @var string |
|
47
|
|
|
* @ORM\Column(type="string") |
|
48
|
|
|
* @JMS\Type("string") |
|
49
|
|
|
*/ |
|
50
|
|
|
private $requirements; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Delegate constructor. |
|
54
|
|
|
* @param string $firstname |
|
55
|
|
|
* @param string $lastname |
|
56
|
|
|
* @param string $email |
|
57
|
|
|
* @param string $company |
|
58
|
|
|
* @param string $twitter |
|
59
|
|
|
* @param string $requirements |
|
60
|
|
|
*/ |
|
61
|
7 |
|
public function __construct(string $firstname, string $lastname, string $email, string $company, string $twitter, string $requirements) |
|
62
|
|
|
{ |
|
63
|
7 |
|
$this->firstname = $firstname; |
|
64
|
7 |
|
$this->lastname = $lastname; |
|
65
|
7 |
|
$this->email = $email; |
|
66
|
7 |
|
$this->company = $company; |
|
67
|
7 |
|
$this->twitter = $twitter; |
|
68
|
7 |
|
$this->requirements = $requirements; |
|
69
|
7 |
|
} |
|
70
|
|
|
|
|
71
|
6 |
|
public static function emptyObject() |
|
72
|
|
|
{ |
|
73
|
6 |
|
return new static('', '', '', '', '', '', ''); |
|
|
|
|
|
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
2 |
|
public static function fromArray(array $data) |
|
77
|
|
|
{ |
|
78
|
2 |
|
return new static( |
|
79
|
2 |
|
$data['firstname'], |
|
80
|
2 |
|
$data['lastname'], |
|
81
|
2 |
|
$data['email'], |
|
82
|
2 |
|
$data['company'], |
|
83
|
2 |
|
$data['twitter'], |
|
84
|
2 |
|
$data['requirements'] |
|
85
|
|
|
); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return string |
|
90
|
|
|
*/ |
|
91
|
2 |
|
public function getFirstname() |
|
92
|
|
|
{ |
|
93
|
2 |
|
return $this->firstname; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @return string |
|
98
|
|
|
*/ |
|
99
|
2 |
|
public function getLastname() |
|
100
|
|
|
{ |
|
101
|
2 |
|
return $this->lastname; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @return string |
|
106
|
|
|
*/ |
|
107
|
2 |
|
public function getEmail() |
|
108
|
|
|
{ |
|
109
|
2 |
|
return $this->email; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @return string |
|
114
|
|
|
*/ |
|
115
|
2 |
|
public function getCompany() |
|
116
|
|
|
{ |
|
117
|
2 |
|
return $this->company; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* @return string |
|
122
|
|
|
*/ |
|
123
|
2 |
|
public function getTwitter() |
|
124
|
|
|
{ |
|
125
|
2 |
|
return $this->twitter; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @return string |
|
130
|
|
|
*/ |
|
131
|
2 |
|
public function getRequirements() |
|
132
|
|
|
{ |
|
133
|
2 |
|
return $this->requirements; |
|
134
|
|
|
} |
|
135
|
|
|
} |
|
136
|
|
|
|
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignorePhpDoc annotation to the duplicate definition and it will be ignored.