1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Omnipay\BillPay; |
4
|
|
|
|
5
|
|
|
use Omnipay\Common\Helper; |
6
|
|
|
use Symfony\Component\HttpFoundation\ParameterBag; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class Company. |
10
|
|
|
*/ |
11
|
|
|
class Company |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var ParameterBag |
15
|
|
|
*/ |
16
|
|
|
protected $parameters; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Create a new item with the specified parameters. |
20
|
|
|
* |
21
|
|
|
* @param array|null $parameters An array of parameters to set on the new object |
22
|
|
|
*/ |
23
|
|
|
public function __construct($parameters = null) |
24
|
|
|
{ |
25
|
|
|
$this->initialize($parameters); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @return array |
30
|
|
|
*/ |
31
|
|
|
public function getParameters() |
32
|
|
|
{ |
33
|
|
|
return $this->parameters->all(); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @return string |
38
|
|
|
*/ |
39
|
|
|
public function getName() |
40
|
|
|
{ |
41
|
|
|
return $this->getParameter('name'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param string $group |
|
|
|
|
46
|
|
|
* |
47
|
|
|
* @return Company |
48
|
|
|
*/ |
49
|
|
|
public function setName($name) |
50
|
|
|
{ |
51
|
|
|
$this->setParameter('name', $name); |
52
|
|
|
|
53
|
|
|
return $this; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function getLegalForm() |
60
|
|
|
{ |
61
|
|
|
return $this->getParameter('legalForm'); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param string $legalForm |
66
|
|
|
* |
67
|
|
|
* @return Company |
68
|
|
|
*/ |
69
|
|
|
public function setLegalForm($legalForm) |
70
|
|
|
{ |
71
|
|
|
$this->setParameter('legalForm', $legalForm); |
72
|
|
|
|
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return string |
78
|
|
|
*/ |
79
|
|
|
public function getRegisterNumber() |
80
|
|
|
{ |
81
|
|
|
return $this->getParameter('registerNumber'); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param string $registerNumber |
86
|
|
|
* |
87
|
|
|
* @return Company |
88
|
|
|
*/ |
89
|
|
|
public function setRegisterNumber($registerNumber) |
90
|
|
|
{ |
91
|
|
|
$this->setParameter('registerNumber', $registerNumber); |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
|
|
public function getHolderName() |
100
|
|
|
{ |
101
|
|
|
return $this->getParameter('holderName'); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string $holderName |
106
|
|
|
* |
107
|
|
|
* @return Company |
108
|
|
|
*/ |
109
|
|
|
public function setHolderName($holderName) |
110
|
|
|
{ |
111
|
|
|
$this->setParameter('holderName', $holderName); |
112
|
|
|
|
113
|
|
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
|
|
public function getTaxNumber() |
120
|
|
|
{ |
121
|
|
|
return $this->getParameter('taxNumber'); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param string $taxNumber |
126
|
|
|
* |
127
|
|
|
* @return Company |
128
|
|
|
*/ |
129
|
|
|
public function setTaxNumber($taxNumber) |
130
|
|
|
{ |
131
|
|
|
$this->setParameter('taxNumber', $taxNumber); |
132
|
|
|
|
133
|
|
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Initialize this item with the specified parameters. |
138
|
|
|
* |
139
|
|
|
* @param array|null $parameters An array of parameters to set on this object |
140
|
|
|
* |
141
|
|
|
* @return Customer |
142
|
|
|
*/ |
143
|
|
|
public function initialize($parameters = null) |
144
|
|
|
{ |
145
|
|
|
$this->parameters = new ParameterBag(); |
146
|
|
|
|
147
|
|
|
if ($parameters !== null) { |
148
|
|
|
Helper::initialize($this, $parameters); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
return $this; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param string $key |
156
|
|
|
* |
157
|
|
|
* @return mixed |
158
|
|
|
*/ |
159
|
|
|
protected function getParameter($key) |
160
|
|
|
{ |
161
|
|
|
return $this->parameters->get($key); |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @param string $key |
166
|
|
|
* @param mixed $value |
167
|
|
|
* |
168
|
|
|
* @return Customer |
169
|
|
|
*/ |
170
|
|
|
protected function setParameter($key, $value) |
171
|
|
|
{ |
172
|
|
|
$this->parameters->set($key, $value); |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
} |
177
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.