1 | <?php |
||||||
2 | |||||||
3 | namespace Pixelpeter\IsoCodesValidation; |
||||||
4 | |||||||
5 | |||||||
6 | use Exception; |
||||||
7 | use Illuminate\Support\Arr; |
||||||
8 | use Illuminate\Validation\Validator as BaseValidator; |
||||||
9 | |||||||
10 | class IsoCodesValidator extends BaseValidator |
||||||
11 | { |
||||||
12 | /** |
||||||
13 | * Validate a BBAN code |
||||||
14 | * |
||||||
15 | * @param $attribute |
||||||
16 | * @param $value |
||||||
17 | * @param $parameters |
||||||
18 | * @return mixed |
||||||
19 | */ |
||||||
20 | public function validateBban($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
21 | { |
||||||
22 | return $this->runIsoCodesValidator(\IsoCodes\Bban::class, $value); |
||||||
23 | } |
||||||
24 | |||||||
25 | /** |
||||||
26 | * Validate a BSN (Dutch citizen service number) |
||||||
27 | * |
||||||
28 | * @param $attribute |
||||||
29 | * @param $value |
||||||
30 | * @param $parameters |
||||||
31 | * @return mixed |
||||||
32 | */ |
||||||
33 | public function validateBsn($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
34 | { |
||||||
35 | return $this->runIsoCodesValidator(\IsoCodes\Bsn::class, $value); |
||||||
36 | } |
||||||
37 | |||||||
38 | /** |
||||||
39 | * Validate a CIF code |
||||||
40 | * |
||||||
41 | * @param $attribute |
||||||
42 | * @param $value |
||||||
43 | * @param $parameters |
||||||
44 | * @return mixed |
||||||
45 | */ |
||||||
46 | public function validateCif($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
47 | { |
||||||
48 | return $this->runIsoCodesValidator(\IsoCodes\Cif::class, $value); |
||||||
49 | } |
||||||
50 | |||||||
51 | /** |
||||||
52 | * Validate a credit card number |
||||||
53 | * |
||||||
54 | * @param $attribute |
||||||
55 | * @param $value |
||||||
56 | * @param $parameters |
||||||
57 | * @return mixed |
||||||
58 | */ |
||||||
59 | public function validateCreditcard($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
60 | { |
||||||
61 | return $this->runIsoCodesValidator(\IsoCodes\CreditCard::class, $value); |
||||||
62 | } |
||||||
63 | |||||||
64 | /** |
||||||
65 | * Validate a EAN-8 code |
||||||
66 | * |
||||||
67 | * @param $attribute |
||||||
68 | * @param $value |
||||||
69 | * @param $parameters |
||||||
70 | * @return mixed |
||||||
71 | */ |
||||||
72 | public function validateEan8($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
73 | { |
||||||
74 | return $this->runIsoCodesValidator(\IsoCodes\Ean8::class, $value); |
||||||
75 | } |
||||||
76 | |||||||
77 | /** |
||||||
78 | * Validate a EAN-13 code |
||||||
79 | * |
||||||
80 | * @param $attribute |
||||||
81 | * @param $value |
||||||
82 | * @param $parameters |
||||||
83 | * @return mixed |
||||||
84 | */ |
||||||
85 | public function validateEan13($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
86 | { |
||||||
87 | return $this->runIsoCodesValidator(\IsoCodes\Ean13::class, $value); |
||||||
88 | } |
||||||
89 | |||||||
90 | /** |
||||||
91 | * Validate a Global Document Type Identifier (GDTI) |
||||||
92 | * |
||||||
93 | * @param $attribute |
||||||
94 | * @param $value |
||||||
95 | * @param $parameters |
||||||
96 | * @return mixed |
||||||
97 | */ |
||||||
98 | public function validateGdti($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
99 | { |
||||||
100 | return $this->runIsoCodesValidator(\IsoCodes\Gdti::class, $value); |
||||||
101 | } |
||||||
102 | |||||||
103 | /** |
||||||
104 | * Validate a Global Location Number (GLN) |
||||||
105 | * |
||||||
106 | * @param $attribute |
||||||
107 | * @param $value |
||||||
108 | * @param $parameters |
||||||
109 | * @return mixed |
||||||
110 | */ |
||||||
111 | public function validateGln($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
112 | { |
||||||
113 | return $this->runIsoCodesValidator(\IsoCodes\Gln::class, $value); |
||||||
114 | } |
||||||
115 | |||||||
116 | /** |
||||||
117 | * Validate a Global Returnable Asset Identifier |
||||||
118 | * |
||||||
119 | * @param $attribute |
||||||
120 | * @param $value |
||||||
121 | * @param $parameters |
||||||
122 | * @return mixed |
||||||
123 | */ |
||||||
124 | public function validateGrai($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
125 | { |
||||||
126 | return $this->runIsoCodesValidator(\IsoCodes\Grai::class, $value); |
||||||
127 | } |
||||||
128 | |||||||
129 | /** |
||||||
130 | * Validate a Global Service Relation Number (GS1) |
||||||
131 | * |
||||||
132 | * @param $attribute |
||||||
133 | * @param $value |
||||||
134 | * @param $parameters |
||||||
135 | * @return mixed |
||||||
136 | */ |
||||||
137 | public function validateGsrn($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
138 | { |
||||||
139 | return $this->runIsoCodesValidator(\IsoCodes\Gsrn::class, $value); |
||||||
140 | } |
||||||
141 | |||||||
142 | /** |
||||||
143 | * Validate a GTIN-8 code |
||||||
144 | * |
||||||
145 | * @param $attribute |
||||||
146 | * @param $value |
||||||
147 | * @param $parameters |
||||||
148 | * @return mixed |
||||||
149 | */ |
||||||
150 | public function validateGtin8($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
151 | { |
||||||
152 | return $this->runIsoCodesValidator(\IsoCodes\Gtin8::class, $value); |
||||||
153 | } |
||||||
154 | |||||||
155 | /** |
||||||
156 | * Validate a GTIN-12 code |
||||||
157 | * |
||||||
158 | * @param $attribute |
||||||
159 | * @param $value |
||||||
160 | * @param $parameters |
||||||
161 | * @return mixed |
||||||
162 | */ |
||||||
163 | public function validateGtin12($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
164 | { |
||||||
165 | return $this->runIsoCodesValidator(\IsoCodes\Gtin12::class, $value); |
||||||
166 | } |
||||||
167 | |||||||
168 | /** |
||||||
169 | * Validate a GTIN-13 code |
||||||
170 | * |
||||||
171 | * @param $attribute |
||||||
172 | * @param $value |
||||||
173 | * @param $parameters |
||||||
174 | * @return mixed |
||||||
175 | */ |
||||||
176 | public function validateGtin13($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
177 | { |
||||||
178 | return $this->runIsoCodesValidator(\IsoCodes\Gtin13::class, $value); |
||||||
179 | } |
||||||
180 | |||||||
181 | /** |
||||||
182 | * Validate a GTIN-14 code |
||||||
183 | * |
||||||
184 | * @param $attribute |
||||||
185 | * @param $value |
||||||
186 | * @param $parameters |
||||||
187 | * @return mixed |
||||||
188 | */ |
||||||
189 | public function validateGtin14($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
190 | { |
||||||
191 | return $this->runIsoCodesValidator(\IsoCodes\Gtin14::class, $value); |
||||||
192 | } |
||||||
193 | |||||||
194 | /** |
||||||
195 | * Validate an IBAN |
||||||
196 | * |
||||||
197 | * @param $attribute |
||||||
198 | * @param $value |
||||||
199 | * @param $parameters |
||||||
200 | * @return mixed |
||||||
201 | */ |
||||||
202 | public function validateIban($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
203 | { |
||||||
204 | return $this->runIsoCodesValidator(\IsoCodes\Iban::class, $value); |
||||||
205 | } |
||||||
206 | |||||||
207 | /** |
||||||
208 | * Validate a "numéro de sécurité sociale" (INSEE) |
||||||
209 | * |
||||||
210 | * @param $attribute |
||||||
211 | * @param $value |
||||||
212 | * @param $parameters |
||||||
213 | * @return mixed |
||||||
214 | */ |
||||||
215 | public function validateInsee($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
216 | { |
||||||
217 | return $this->runIsoCodesValidator(\IsoCodes\Insee::class, $value); |
||||||
218 | } |
||||||
219 | |||||||
220 | /** |
||||||
221 | * Validate an IP address |
||||||
222 | * |
||||||
223 | * @param $attribute |
||||||
224 | * @param $value |
||||||
225 | * @param $parameters |
||||||
226 | * @return mixed |
||||||
227 | */ |
||||||
228 | public function validateIpaddress($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
229 | { |
||||||
230 | return $this->runIsoCodesValidator(\IsoCodes\IP::class, $value); |
||||||
231 | } |
||||||
232 | |||||||
233 | /** |
||||||
234 | * Validate an ISBN |
||||||
235 | * |
||||||
236 | * @param $attribute |
||||||
237 | * @param $value |
||||||
238 | * @param $parameters |
||||||
239 | * @return mixed |
||||||
240 | */ |
||||||
241 | public function validateIsbn($attribute, $value, $parameters) |
||||||
242 | { |
||||||
243 | $this->requireParameterCount(1, $parameters, 'isbn'); |
||||||
244 | $type = $this->prepareReference($attribute, $parameters); |
||||||
245 | |||||||
246 | return $this->runIsoCodesValidator(\IsoCodes\Isbn::class, $value, $type); |
||||||
0 ignored issues
–
show
It seems like
$type can also be of type array ; however, parameter $reference of Pixelpeter\IsoCodesValid...:runIsoCodesValidator() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
247 | } |
||||||
248 | |||||||
249 | /** |
||||||
250 | * Validate an "International Securities Identification Number" (ISIN) |
||||||
251 | * |
||||||
252 | * @param $attribute |
||||||
253 | * @param $value |
||||||
254 | * @param $parameters |
||||||
255 | * @return mixed |
||||||
256 | */ |
||||||
257 | public function validateIsin($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
258 | { |
||||||
259 | return $this->runIsoCodesValidator(\IsoCodes\Isin::class, $value); |
||||||
260 | } |
||||||
261 | |||||||
262 | /** |
||||||
263 | * Validate an "International Standard Music Number" or ISMN (ISO 10957) |
||||||
264 | * |
||||||
265 | * @param $attribute |
||||||
266 | * @param $value |
||||||
267 | * @param $parameters |
||||||
268 | * @return mixed |
||||||
269 | */ |
||||||
270 | public function validateIsmn($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
271 | { |
||||||
272 | return $this->runIsoCodesValidator(\IsoCodes\Ismn::class, $value); |
||||||
273 | } |
||||||
274 | |||||||
275 | /** |
||||||
276 | * Validate an "International Standard Musical Work Code" (ISWC) |
||||||
277 | * |
||||||
278 | * @param $attribute |
||||||
279 | * @param $value |
||||||
280 | * @param $parameters |
||||||
281 | * @return mixed |
||||||
282 | */ |
||||||
283 | public function validateIswc($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
284 | { |
||||||
285 | return $this->runIsoCodesValidator(\IsoCodes\Iswc::class, $value); |
||||||
286 | } |
||||||
287 | |||||||
288 | /** |
||||||
289 | * Validate a MAC address |
||||||
290 | * |
||||||
291 | * @param $attribute |
||||||
292 | * @param $value |
||||||
293 | * @param $parameters |
||||||
294 | * @return mixed |
||||||
295 | */ |
||||||
296 | public function validateMac($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
297 | { |
||||||
298 | return $this->runIsoCodesValidator(\IsoCodes\Mac::class, $value); |
||||||
299 | } |
||||||
300 | |||||||
301 | /** |
||||||
302 | * Validate a "Número de Identificación Fiscal" (NIF) |
||||||
303 | * |
||||||
304 | * @param $attribute |
||||||
305 | * @param $value |
||||||
306 | * @param $parameters |
||||||
307 | * @return mixed |
||||||
308 | */ |
||||||
309 | public function validateNif($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
310 | { |
||||||
311 | return $this->runIsoCodesValidator(\IsoCodes\Nif::class, $value); |
||||||
312 | } |
||||||
313 | |||||||
314 | /** |
||||||
315 | * Validate a "Organisme Type12 Norme B2" |
||||||
316 | * |
||||||
317 | * @param $attribute |
||||||
318 | * @param $value |
||||||
319 | * @param $parameters |
||||||
320 | * @return mixed |
||||||
321 | */ |
||||||
322 | public function validateOrganismeType12NormeB2($attribute, $value, $parameters) |
||||||
323 | { |
||||||
324 | $this->requireParameterCount(1, $parameters, 'organisme_type12_norme_b2'); |
||||||
325 | $clef = $this->prepareReference($attribute, $parameters); |
||||||
326 | |||||||
327 | return $this->runIsoCodesValidator(\IsoCodes\OrganismeType12NormeB2::class, $value, $clef); |
||||||
0 ignored issues
–
show
It seems like
$clef can also be of type array ; however, parameter $reference of Pixelpeter\IsoCodesValid...:runIsoCodesValidator() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
328 | } |
||||||
329 | |||||||
330 | /** |
||||||
331 | * Validate a phone number |
||||||
332 | * |
||||||
333 | * @param $attribute |
||||||
334 | * @param $value |
||||||
335 | * @param $parameters |
||||||
336 | * @return mixed |
||||||
337 | */ |
||||||
338 | public function validatePhonenumber($attribute, $value, $parameters) |
||||||
339 | { |
||||||
340 | $this->requireParameterCount(1, $parameters, 'phonenumber'); |
||||||
341 | $country = $this->prepareReference($attribute, $parameters); |
||||||
342 | |||||||
343 | return $this->runIsoCodesValidator(\IsoCodes\PhoneNumber::class, $value, $country); |
||||||
0 ignored issues
–
show
It seems like
$country can also be of type array ; however, parameter $reference of Pixelpeter\IsoCodesValid...:runIsoCodesValidator() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
344 | } |
||||||
345 | |||||||
346 | /** |
||||||
347 | * Validate a Stock Exchange Daily Official List (SEDOL) |
||||||
348 | * |
||||||
349 | * @param $attribute |
||||||
350 | * @param $value |
||||||
351 | * @param $parameters |
||||||
352 | * @return mixed |
||||||
353 | */ |
||||||
354 | public function validateSedol($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
355 | { |
||||||
356 | return $this->runIsoCodesValidator(\IsoCodes\Sedol::class, $value); |
||||||
357 | } |
||||||
358 | |||||||
359 | /** |
||||||
360 | * Validate "Système d’Identification du Répertoire des Entreprises" (SIREN) |
||||||
361 | * |
||||||
362 | * @param $attribute |
||||||
363 | * @param $value |
||||||
364 | * @param $parameters |
||||||
365 | * @return mixed |
||||||
366 | */ |
||||||
367 | public function validateSiren($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
368 | { |
||||||
369 | return $this->runIsoCodesValidator(\IsoCodes\Siren::class, $value); |
||||||
370 | } |
||||||
371 | |||||||
372 | /** |
||||||
373 | * Validate "Système d’Identification du Répertoire des ETablissements" (SIRET) |
||||||
374 | * |
||||||
375 | * @param $attribute |
||||||
376 | * @param $value |
||||||
377 | * @param $parameters |
||||||
378 | * @return mixed |
||||||
379 | */ |
||||||
380 | public function validateSiret($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
381 | { |
||||||
382 | return $this->runIsoCodesValidator(\IsoCodes\Siret::class, $value); |
||||||
383 | } |
||||||
384 | |||||||
385 | /** |
||||||
386 | * Validate a European/International Article Number (SSCC) |
||||||
387 | * |
||||||
388 | * @param $attribute |
||||||
389 | * @param $value |
||||||
390 | * @param $parameters |
||||||
391 | * @return mixed |
||||||
392 | */ |
||||||
393 | public function validateSscc($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
394 | { |
||||||
395 | return $this->runIsoCodesValidator(\IsoCodes\Sscc::class, $value); |
||||||
396 | } |
||||||
397 | |||||||
398 | /** |
||||||
399 | * Validate a Social Security Number (SSN) |
||||||
400 | * |
||||||
401 | * @param $attribute |
||||||
402 | * @param $value |
||||||
403 | * @param $parameters |
||||||
404 | * @return mixed |
||||||
405 | */ |
||||||
406 | public function validateSsn($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
407 | { |
||||||
408 | return $this->runIsoCodesValidator(\IsoCodes\Ssn::class, $value); |
||||||
409 | } |
||||||
410 | |||||||
411 | /** |
||||||
412 | * Validate structured communication |
||||||
413 | * |
||||||
414 | * @param $attribute |
||||||
415 | * @param $value |
||||||
416 | * @param $parameters |
||||||
417 | * @return mixed |
||||||
418 | */ |
||||||
419 | public function validateStructuredCommunication($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
420 | { |
||||||
421 | return $this->runIsoCodesValidator(\IsoCodes\StructuredCommunication::class, $value); |
||||||
422 | } |
||||||
423 | |||||||
424 | /** |
||||||
425 | * Validate a SWIFT/BIC |
||||||
426 | * |
||||||
427 | * @param $attribute |
||||||
428 | * @param $value |
||||||
429 | * @param $parameters |
||||||
430 | * @return mixed |
||||||
431 | */ |
||||||
432 | public function validateSwiftBic($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
433 | { |
||||||
434 | return $this->runIsoCodesValidator(\IsoCodes\SwiftBic::class, $value); |
||||||
435 | } |
||||||
436 | |||||||
437 | /** |
||||||
438 | * Validate a Unique Device Identification |
||||||
439 | * |
||||||
440 | * @param $attribute |
||||||
441 | * @param $value |
||||||
442 | * @param $parameters |
||||||
443 | * @return mixed |
||||||
444 | */ |
||||||
445 | public function validateUdi($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
446 | { |
||||||
447 | return $this->runIsoCodesValidator(\IsoCodes\Udi::class, $value); |
||||||
448 | } |
||||||
449 | |||||||
450 | /** |
||||||
451 | * Validate a UK National Insurance Number |
||||||
452 | * |
||||||
453 | * @param $attribute |
||||||
454 | * @param $value |
||||||
455 | * @param $parameters |
||||||
456 | * @return mixed |
||||||
457 | */ |
||||||
458 | public function validateUknin($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
459 | { |
||||||
460 | return $this->runIsoCodesValidator(\IsoCodes\Uknin::class, $value); |
||||||
461 | } |
||||||
462 | |||||||
463 | /** |
||||||
464 | * Validate a Universal Product Code |
||||||
465 | * |
||||||
466 | * @param $attribute |
||||||
467 | * @param $value |
||||||
468 | * @param $parameters |
||||||
469 | * @return mixed |
||||||
470 | */ |
||||||
471 | public function validateUpca($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
472 | { |
||||||
473 | return $this->runIsoCodesValidator(\IsoCodes\Upca::class, $value); |
||||||
474 | } |
||||||
475 | |||||||
476 | /** |
||||||
477 | * Validate Value Added Tax (VAT) |
||||||
478 | * |
||||||
479 | * @param $attribute |
||||||
480 | * @param $value |
||||||
481 | * @param $parameters |
||||||
482 | * @return mixed |
||||||
483 | */ |
||||||
484 | public function validateVat($attribute, $value, $parameters) |
||||||
0 ignored issues
–
show
The parameter
$attribute is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
Loading history...
|
|||||||
485 | { |
||||||
486 | return $this->runIsoCodesValidator(\IsoCodes\Vat::class, $value); |
||||||
487 | } |
||||||
488 | |||||||
489 | /** |
||||||
490 | * Validate a zip code |
||||||
491 | * |
||||||
492 | * @param $attribute |
||||||
493 | * @param $value |
||||||
494 | * @param $parameters |
||||||
495 | * @return mixed |
||||||
496 | */ |
||||||
497 | public function validateZipcode($attribute, $value, $parameters) |
||||||
498 | { |
||||||
499 | $this->requireParameterCount(1, $parameters, 'zipcode'); |
||||||
500 | $country = $this->prepareReference($attribute, $parameters); |
||||||
501 | |||||||
502 | return $this->runIsoCodesValidator(\IsoCodes\ZipCode::class, $value, $country); |
||||||
0 ignored issues
–
show
It seems like
$country can also be of type array ; however, parameter $reference of Pixelpeter\IsoCodesValid...:runIsoCodesValidator() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
503 | } |
||||||
504 | |||||||
505 | /** |
||||||
506 | * Prepare/get the reference when defined in dot notation |
||||||
507 | * |
||||||
508 | * @param $attribute |
||||||
509 | * @param $parameters |
||||||
510 | * @return mixed |
||||||
511 | */ |
||||||
512 | protected function prepareReference($attribute, $parameters) |
||||||
513 | { |
||||||
514 | if ($keys = $this->getExplicitKeys($attribute)) { |
||||||
515 | $parameters = $this->replaceAsterisksInParameters($parameters, $keys); |
||||||
516 | } |
||||||
517 | |||||||
518 | return Arr::get($this->data, $parameters[0], $parameters[0]); |
||||||
519 | } |
||||||
520 | |||||||
521 | /** |
||||||
522 | * Execute the validation function |
||||||
523 | * and catch every other Exception from underlying libraries |
||||||
524 | * so we will only display the Laravel validation error |
||||||
525 | * |
||||||
526 | * @param $validator |
||||||
527 | * @param $value |
||||||
528 | * @param string $reference |
||||||
529 | * @return mixed |
||||||
530 | */ |
||||||
531 | protected function runIsoCodesValidator($validator, $value, $reference = '') |
||||||
532 | { |
||||||
533 | try { |
||||||
534 | if (empty($reference)) { |
||||||
535 | return call_user_func($validator . '::validate', $value); |
||||||
536 | } |
||||||
537 | |||||||
538 | return call_user_func($validator . '::validate', $value, $reference); |
||||||
539 | } catch (Exception $e) { |
||||||
540 | // do nothing |
||||||
541 | } |
||||||
542 | } |
||||||
543 | |||||||
544 | /** |
||||||
545 | * Replace all country place-holders |
||||||
546 | * |
||||||
547 | * @param $message |
||||||
548 | * @param $parameter |
||||||
549 | * @return mixed |
||||||
550 | */ |
||||||
551 | protected function countryReplacer($message, $reference) |
||||||
552 | { |
||||||
553 | return str_replace(':country', $reference, $message); |
||||||
554 | } |
||||||
555 | |||||||
556 | /** |
||||||
557 | * Replace all value place-holders |
||||||
558 | * |
||||||
559 | * @param $message |
||||||
560 | * @param $attribute |
||||||
561 | * @return mixed |
||||||
562 | */ |
||||||
563 | protected function valueReplacer($message, $attribute) |
||||||
564 | { |
||||||
565 | return str_replace(':value', $this->getValue($attribute), $message); |
||||||
566 | } |
||||||
567 | |||||||
568 | /** |
||||||
569 | * Replace all place-holders for the bban rule |
||||||
570 | * |
||||||
571 | * @param $message |
||||||
572 | * @param $attribute |
||||||
573 | * @param $rule |
||||||
574 | * @param $parameter |
||||||
575 | * @return mixed |
||||||
576 | */ |
||||||
577 | public function replaceBban($message, $attribute, $rule, $parameter) |
||||||
578 | { |
||||||
579 | return $this->valueReplacer($message, $attribute); |
||||||
580 | } |
||||||
581 | |||||||
582 | /** |
||||||
583 | * Replace all place-holders for the bsn rule |
||||||
584 | * |
||||||
585 | * @param $message |
||||||
586 | * @param $attribute |
||||||
587 | * @param $rule |
||||||
588 | * @param $parameter |
||||||
589 | * @return mixed |
||||||
590 | */ |
||||||
591 | public function replaceBsn($message, $attribute, $rule, $parameter) |
||||||
592 | { |
||||||
593 | return $this->valueReplacer($message, $attribute); |
||||||
594 | } |
||||||
595 | |||||||
596 | /** |
||||||
597 | * Replace all place-holders for the cif rule |
||||||
598 | * |
||||||
599 | * @param $message |
||||||
600 | * @param $attribute |
||||||
601 | * @param $rule |
||||||
602 | * @param $parameter |
||||||
603 | * @return mixed |
||||||
604 | */ |
||||||
605 | public function replaceCif($message, $attribute, $rule, $parameter) |
||||||
606 | { |
||||||
607 | return $this->valueReplacer($message, $attribute); |
||||||
608 | } |
||||||
609 | |||||||
610 | /** |
||||||
611 | * Replace all place-holders for the creditcard rule |
||||||
612 | * |
||||||
613 | * @param $message |
||||||
614 | * @param $attribute |
||||||
615 | * @param $rule |
||||||
616 | * @param $parameter |
||||||
617 | * @return mixed |
||||||
618 | */ |
||||||
619 | public function replaceCreditcard($message, $attribute, $rule, $parameter) |
||||||
620 | { |
||||||
621 | return $this->valueReplacer($message, $attribute); |
||||||
622 | } |
||||||
623 | |||||||
624 | /** |
||||||
625 | * Replace all place-holders for the ena8 rule |
||||||
626 | * |
||||||
627 | * @param $message |
||||||
628 | * @param $attribute |
||||||
629 | * @param $rule |
||||||
630 | * @param $parameter |
||||||
631 | * @return mixed |
||||||
632 | */ |
||||||
633 | public function replaceEan8($message, $attribute, $rule, $parameter) |
||||||
634 | { |
||||||
635 | return $this->valueReplacer($message, $attribute); |
||||||
636 | } |
||||||
637 | |||||||
638 | /** |
||||||
639 | * Replace all place-holders for the ean13 rule |
||||||
640 | * |
||||||
641 | * @param $message |
||||||
642 | * @param $attribute |
||||||
643 | * @param $rule |
||||||
644 | * @param $parameter |
||||||
645 | * @return mixed |
||||||
646 | */ |
||||||
647 | public function replaceEan13($message, $attribute, $rule, $parameter) |
||||||
648 | { |
||||||
649 | return $this->valueReplacer($message, $attribute); |
||||||
650 | } |
||||||
651 | |||||||
652 | /** |
||||||
653 | * Replace all place-holders for the gdti rule |
||||||
654 | * |
||||||
655 | * @param $message |
||||||
656 | * @param $attribute |
||||||
657 | * @param $rule |
||||||
658 | * @param $parameter |
||||||
659 | * @return mixed |
||||||
660 | */ |
||||||
661 | public function replaceGdti($message, $attribute, $rule, $parameter) |
||||||
662 | { |
||||||
663 | return $this->valueReplacer($message, $attribute); |
||||||
664 | } |
||||||
665 | |||||||
666 | /** |
||||||
667 | * Replace all place-holders for the gln rule |
||||||
668 | * |
||||||
669 | * @param $message |
||||||
670 | * @param $attribute |
||||||
671 | * @param $rule |
||||||
672 | * @param $parameter |
||||||
673 | * @return mixed |
||||||
674 | */ |
||||||
675 | public function replaceGln($message, $attribute, $rule, $parameter) |
||||||
676 | { |
||||||
677 | return $this->valueReplacer($message, $attribute); |
||||||
678 | } |
||||||
679 | |||||||
680 | /** |
||||||
681 | * Replace all place-holders for the grai rule |
||||||
682 | * |
||||||
683 | * @param $message |
||||||
684 | * @param $attribute |
||||||
685 | * @param $rule |
||||||
686 | * @param $parameter |
||||||
687 | * @return mixed |
||||||
688 | */ |
||||||
689 | public function replaceGrai($message, $attribute, $rule, $parameter) |
||||||
690 | { |
||||||
691 | return $this->valueReplacer($message, $attribute); |
||||||
692 | } |
||||||
693 | |||||||
694 | /** |
||||||
695 | * Replace all place-holders for the gsrn rule |
||||||
696 | * |
||||||
697 | * @param $message |
||||||
698 | * @param $attribute |
||||||
699 | * @param $rule |
||||||
700 | * @param $parameter |
||||||
701 | * @return mixed |
||||||
702 | */ |
||||||
703 | public function replaceGsrn($message, $attribute, $rule, $parameter) |
||||||
704 | { |
||||||
705 | return $this->valueReplacer($message, $attribute); |
||||||
706 | } |
||||||
707 | |||||||
708 | /** |
||||||
709 | * Replace all place-holders for the gitin8 rule |
||||||
710 | * |
||||||
711 | * @param $message |
||||||
712 | * @param $attribute |
||||||
713 | * @param $rule |
||||||
714 | * @param $parameter |
||||||
715 | * @return mixed |
||||||
716 | */ |
||||||
717 | public function replaceGtin8($message, $attribute, $rule, $parameter) |
||||||
718 | { |
||||||
719 | return $this->valueReplacer($message, $attribute); |
||||||
720 | } |
||||||
721 | |||||||
722 | /** |
||||||
723 | * Replace all place-holders for the gtin12 rule |
||||||
724 | * |
||||||
725 | * @param $message |
||||||
726 | * @param $attribute |
||||||
727 | * @param $rule |
||||||
728 | * @param $parameter |
||||||
729 | * @return mixed |
||||||
730 | */ |
||||||
731 | public function replaceGtin12($message, $attribute, $rule, $parameter) |
||||||
732 | { |
||||||
733 | return $this->valueReplacer($message, $attribute); |
||||||
734 | } |
||||||
735 | |||||||
736 | /** |
||||||
737 | * Replace all place-holders for the gtin13 rule |
||||||
738 | * |
||||||
739 | * @param $message |
||||||
740 | * @param $attribute |
||||||
741 | * @param $rule |
||||||
742 | * @param $parameter |
||||||
743 | * @return mixed |
||||||
744 | */ |
||||||
745 | public function replaceGtin13($message, $attribute, $rule, $parameter) |
||||||
746 | { |
||||||
747 | return $this->valueReplacer($message, $attribute); |
||||||
748 | } |
||||||
749 | |||||||
750 | /** |
||||||
751 | * Replace all place-holders for the gtin14 rule |
||||||
752 | * |
||||||
753 | * @param $message |
||||||
754 | * @param $attribute |
||||||
755 | * @param $rule |
||||||
756 | * @param $parameter |
||||||
757 | * @return mixed |
||||||
758 | */ |
||||||
759 | public function replaceGtin14($message, $attribute, $rule, $parameter) |
||||||
760 | { |
||||||
761 | return $this->valueReplacer($message, $attribute); |
||||||
762 | } |
||||||
763 | |||||||
764 | /** |
||||||
765 | * Replace all place-holders for the iban rule |
||||||
766 | * |
||||||
767 | * @param $message |
||||||
768 | * @param $attribute |
||||||
769 | * @param $rule |
||||||
770 | * @param $parameter |
||||||
771 | * @return mixed |
||||||
772 | */ |
||||||
773 | public function replaceIban($message, $attribute, $rule, $parameter) |
||||||
774 | { |
||||||
775 | return $this->valueReplacer($message, $attribute); |
||||||
776 | } |
||||||
777 | |||||||
778 | /** |
||||||
779 | * Replace all place-holders for the insee rule |
||||||
780 | * |
||||||
781 | * @param $message |
||||||
782 | * @param $attribute |
||||||
783 | * @param $rule |
||||||
784 | * @param $parameter |
||||||
785 | * @return mixed |
||||||
786 | */ |
||||||
787 | public function replaceInsee($message, $attribute, $rule, $parameter) |
||||||
788 | { |
||||||
789 | return $this->valueReplacer($message, $attribute); |
||||||
790 | } |
||||||
791 | |||||||
792 | /** |
||||||
793 | * Replace all place-holders for the ipaddress rule |
||||||
794 | * |
||||||
795 | * @param $message |
||||||
796 | * @param $attribute |
||||||
797 | * @param $rule |
||||||
798 | * @param $parameter |
||||||
799 | * @return mixed |
||||||
800 | */ |
||||||
801 | public function replaceIpaddress($message, $attribute, $rule, $parameter) |
||||||
802 | { |
||||||
803 | return $this->valueReplacer($message, $attribute); |
||||||
804 | } |
||||||
805 | |||||||
806 | /** |
||||||
807 | * Replace all place-holders for the isbn rule |
||||||
808 | * |
||||||
809 | * @param $message |
||||||
810 | * @param $attribute |
||||||
811 | * @param $rule |
||||||
812 | * @param $parameter |
||||||
813 | * @return mixed |
||||||
814 | */ |
||||||
815 | public function replaceIsbn($message, $attribute, $rule, $parameter) |
||||||
816 | { |
||||||
817 | return $this->valueReplacer($message, $attribute); |
||||||
818 | } |
||||||
819 | |||||||
820 | /** |
||||||
821 | * Replace all place-holders for the isin rule |
||||||
822 | * |
||||||
823 | * @param $message |
||||||
824 | * @param $attribute |
||||||
825 | * @param $rule |
||||||
826 | * @param $parameter |
||||||
827 | * @return mixed |
||||||
828 | */ |
||||||
829 | public function replaceIsin($message, $attribute, $rule, $parameter) |
||||||
830 | { |
||||||
831 | return $this->valueReplacer($message, $attribute); |
||||||
832 | } |
||||||
833 | |||||||
834 | /** |
||||||
835 | * Replace all place-holders for the ismn rule |
||||||
836 | * |
||||||
837 | * @param $message |
||||||
838 | * @param $attribute |
||||||
839 | * @param $rule |
||||||
840 | * @param $parameter |
||||||
841 | * @return mixed |
||||||
842 | */ |
||||||
843 | public function replaceIsmn($message, $attribute, $rule, $parameter) |
||||||
844 | { |
||||||
845 | return $this->valueReplacer($message, $attribute); |
||||||
846 | } |
||||||
847 | |||||||
848 | /** |
||||||
849 | * Replace all place-holders for the iswc rule |
||||||
850 | * |
||||||
851 | * @param $message |
||||||
852 | * @param $attribute |
||||||
853 | * @param $rule |
||||||
854 | * @param $parameter |
||||||
855 | * @return mixed |
||||||
856 | */ |
||||||
857 | public function replaceIswc($message, $attribute, $rule, $parameter) |
||||||
858 | { |
||||||
859 | return $this->valueReplacer($message, $attribute); |
||||||
860 | } |
||||||
861 | |||||||
862 | /** |
||||||
863 | * Replace all place-holders for the mac rule |
||||||
864 | * |
||||||
865 | * @param $message |
||||||
866 | * @param $attribute |
||||||
867 | * @param $rule |
||||||
868 | * @param $parameter |
||||||
869 | * @return mixed |
||||||
870 | */ |
||||||
871 | public function replaceMac($message, $attribute, $rule, $parameter) |
||||||
872 | { |
||||||
873 | return $this->valueReplacer($message, $attribute); |
||||||
874 | } |
||||||
875 | |||||||
876 | /** |
||||||
877 | * Replace all place-holders for the nif rule |
||||||
878 | * |
||||||
879 | * @param $message |
||||||
880 | * @param $attribute |
||||||
881 | * @param $rule |
||||||
882 | * @param $parameter |
||||||
883 | * @return mixed |
||||||
884 | */ |
||||||
885 | public function replaceNif($message, $attribute, $rule, $parameter) |
||||||
886 | { |
||||||
887 | return $this->valueReplacer($message, $attribute); |
||||||
888 | } |
||||||
889 | |||||||
890 | /** |
||||||
891 | * Replace all place-holders for the organisme_type12_norme_b2 rule |
||||||
892 | * |
||||||
893 | * @param $message |
||||||
894 | * @param $attribute |
||||||
895 | * @param $rule |
||||||
896 | * @param $parameter |
||||||
897 | * @return mixed |
||||||
898 | */ |
||||||
899 | public function replaceOrganismeType12NormeB2($message, $attribute, $rule, $parameter) |
||||||
900 | { |
||||||
901 | return $this->valueReplacer($message, $attribute); |
||||||
902 | } |
||||||
903 | |||||||
904 | /** |
||||||
905 | * Replace all place-holders for the phonenumber rule |
||||||
906 | * |
||||||
907 | * @param $message |
||||||
908 | * @param $attribute |
||||||
909 | * @param $rule |
||||||
910 | * @param $parameter |
||||||
911 | * @return mixed |
||||||
912 | */ |
||||||
913 | protected function replacePhonenumber($message, $attribute, $rule, $parameter) |
||||||
914 | { |
||||||
915 | $reference = $this->prepareReference($attribute, $parameter); |
||||||
916 | |||||||
917 | $message = $this->valueReplacer($message, $attribute); |
||||||
918 | $message = $this->countryReplacer($message, $reference); |
||||||
919 | |||||||
920 | return $message; |
||||||
921 | } |
||||||
922 | |||||||
923 | /** |
||||||
924 | * Replace all place-holders for the sedol rule |
||||||
925 | * |
||||||
926 | * @param $message |
||||||
927 | * @param $attribute |
||||||
928 | * @param $rule |
||||||
929 | * @param $parameter |
||||||
930 | * @return mixed |
||||||
931 | */ |
||||||
932 | public function replaceSedol($message, $attribute, $rule, $parameter) |
||||||
933 | { |
||||||
934 | return $this->valueReplacer($message, $attribute); |
||||||
935 | } |
||||||
936 | |||||||
937 | /** |
||||||
938 | * Replace all place-holders for the siren rule |
||||||
939 | * |
||||||
940 | * @param $message |
||||||
941 | * @param $attribute |
||||||
942 | * @param $rule |
||||||
943 | * @param $parameter |
||||||
944 | * @return mixed |
||||||
945 | */ |
||||||
946 | public function replaceSiren($message, $attribute, $rule, $parameter) |
||||||
947 | { |
||||||
948 | return $this->valueReplacer($message, $attribute); |
||||||
949 | } |
||||||
950 | |||||||
951 | /** |
||||||
952 | * Replace all place-holders for the siret rule |
||||||
953 | * |
||||||
954 | * @param $message |
||||||
955 | * @param $attribute |
||||||
956 | * @param $rule |
||||||
957 | * @param $parameter |
||||||
958 | * @return mixed |
||||||
959 | */ |
||||||
960 | public function replaceSiret($message, $attribute, $rule, $parameter) |
||||||
961 | { |
||||||
962 | return $this->valueReplacer($message, $attribute); |
||||||
963 | } |
||||||
964 | |||||||
965 | /** |
||||||
966 | * Replace all place-holders for the sscc rule |
||||||
967 | * |
||||||
968 | * @param $message |
||||||
969 | * @param $attribute |
||||||
970 | * @param $rule |
||||||
971 | * @param $parameter |
||||||
972 | * @return mixed |
||||||
973 | */ |
||||||
974 | public function replaceSscc($message, $attribute, $rule, $parameter) |
||||||
975 | { |
||||||
976 | return $this->valueReplacer($message, $attribute); |
||||||
977 | } |
||||||
978 | |||||||
979 | /** |
||||||
980 | * Replace all place-holders for the ssn rule |
||||||
981 | * |
||||||
982 | * @param $message |
||||||
983 | * @param $attribute |
||||||
984 | * @param $rule |
||||||
985 | * @param $parameter |
||||||
986 | * @return mixed |
||||||
987 | */ |
||||||
988 | public function replaceSSn($message, $attribute, $rule, $parameter) |
||||||
989 | { |
||||||
990 | return $this->valueReplacer($message, $attribute); |
||||||
991 | } |
||||||
992 | |||||||
993 | /** |
||||||
994 | * Replace all place-holders for the structured_communication rule |
||||||
995 | * |
||||||
996 | * @param $message |
||||||
997 | * @param $attribute |
||||||
998 | * @param $rule |
||||||
999 | * @param $parameter |
||||||
1000 | * @return mixed |
||||||
1001 | */ |
||||||
1002 | public function replaceStructuredCommunication($message, $attribute, $rule, $parameter) |
||||||
1003 | { |
||||||
1004 | return $this->valueReplacer($message, $attribute); |
||||||
1005 | } |
||||||
1006 | |||||||
1007 | /** |
||||||
1008 | * Replace all place-holders for the swift_bic rule |
||||||
1009 | * |
||||||
1010 | * @param $message |
||||||
1011 | * @param $attribute |
||||||
1012 | * @param $rule |
||||||
1013 | * @param $parameter |
||||||
1014 | * @return mixed |
||||||
1015 | */ |
||||||
1016 | public function replaceSwiftBic($message, $attribute, $rule, $parameter) |
||||||
1017 | { |
||||||
1018 | return $this->valueReplacer($message, $attribute); |
||||||
1019 | } |
||||||
1020 | |||||||
1021 | /** |
||||||
1022 | * Replace all place-holders for the udi rule |
||||||
1023 | * |
||||||
1024 | * @param $message |
||||||
1025 | * @param $attribute |
||||||
1026 | * @param $rule |
||||||
1027 | * @param $parameter |
||||||
1028 | * @return mixed |
||||||
1029 | */ |
||||||
1030 | public function replaceUdi($message, $attribute, $rule, $parameter) |
||||||
1031 | { |
||||||
1032 | return $this->valueReplacer($message, $attribute); |
||||||
1033 | } |
||||||
1034 | |||||||
1035 | /** |
||||||
1036 | * Replace all place-holders for the uknin rule |
||||||
1037 | * |
||||||
1038 | * @param $message |
||||||
1039 | * @param $attribute |
||||||
1040 | * @param $rule |
||||||
1041 | * @param $parameter |
||||||
1042 | * @return mixed |
||||||
1043 | */ |
||||||
1044 | public function replaceUknin($message, $attribute, $rule, $parameter) |
||||||
1045 | { |
||||||
1046 | return $this->valueReplacer($message, $attribute); |
||||||
1047 | } |
||||||
1048 | |||||||
1049 | /** |
||||||
1050 | * Replace all place-holders for the upca rule |
||||||
1051 | * |
||||||
1052 | * @param $message |
||||||
1053 | * @param $attribute |
||||||
1054 | * @param $rule |
||||||
1055 | * @param $parameter |
||||||
1056 | * @return mixed |
||||||
1057 | */ |
||||||
1058 | public function replaceUpca($message, $attribute, $rule, $parameter) |
||||||
1059 | { |
||||||
1060 | return $this->valueReplacer($message, $attribute); |
||||||
1061 | } |
||||||
1062 | |||||||
1063 | /** |
||||||
1064 | * Replace all place-holders for the vat rule |
||||||
1065 | * |
||||||
1066 | * @param $message |
||||||
1067 | * @param $attribute |
||||||
1068 | * @param $rule |
||||||
1069 | * @param $parameter |
||||||
1070 | * @return mixed |
||||||
1071 | */ |
||||||
1072 | public function replaceVat($message, $attribute, $rule, $parameter) |
||||||
1073 | { |
||||||
1074 | return $this->valueReplacer($message, $attribute); |
||||||
1075 | } |
||||||
1076 | |||||||
1077 | /** |
||||||
1078 | * Replace all place-holders for the zipcode rule |
||||||
1079 | * |
||||||
1080 | * @param $message |
||||||
1081 | * @param $attribute |
||||||
1082 | * @param $rule |
||||||
1083 | * @param $parameter |
||||||
1084 | * @return mixed |
||||||
1085 | */ |
||||||
1086 | public function replaceZipcode($message, $attribute, $rule, $parameter) |
||||||
1087 | { |
||||||
1088 | $reference = $this->prepareReference($attribute, $parameter); |
||||||
1089 | |||||||
1090 | $message = $this->valueReplacer($message, $attribute); |
||||||
1091 | $message = $this->countryReplacer($message, $reference); |
||||||
1092 | |||||||
1093 | return $message; |
||||||
1094 | } |
||||||
1095 | } |
||||||
1096 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.