Completed
Push — master ( 456230...2067b0 )
by Peter
07:21
created

IsoCodesValidator::validateVat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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 GTIN-8 code
92
     *
93
     * @param $attribute
94
     * @param $value
95
     * @param $parameters
96
     * @return mixed
97
     */
98
    public function validateGtin8($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Gtin8::class, $value);
101
    }
102
103
    /**
104
     * Validate a GTIN-12 code
105
     *
106
     * @param $attribute
107
     * @param $value
108
     * @param $parameters
109
     * @return mixed
110
     */
111
    public function validateGtin12($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Gtin12::class, $value);
114
    }
115
116
    /**
117
     * Validate a GTIN-13 code
118
     *
119
     * @param $attribute
120
     * @param $value
121
     * @param $parameters
122
     * @return mixed
123
     */
124
    public function validateGtin13($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Gtin13::class, $value);
127
    }
128
129
    /**
130
     * Validate a GTIN-14 code
131
     *
132
     * @param $attribute
133
     * @param $value
134
     * @param $parameters
135
     * @return mixed
136
     */
137
    public function validateGtin14($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Gtin14::class, $value);
140
    }
141
142
    /**
143
     * Validate an IBAN
144
     *
145
     * @param $attribute
146
     * @param $value
147
     * @param $parameters
148
     * @return mixed
149
     */
150
    public function validateIban($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Iban::class, $value);
153
    }
154
155
    /**
156
     * Validate a "numéro de sécurité sociale" (INSEE)
157
     *
158
     * @param $attribute
159
     * @param $value
160
     * @param $parameters
161
     * @return mixed
162
     */
163
    public function validateInsee($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from 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\Insee::class, $value);
166
    }
167
168
    public function validateIpaddress($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
169
    {
170
        return $this->runIsoCodesValidator(\IsoCodes\IP::class, $value);
171
    }
172
173
    /**
174
     * Validate an ISBN
175
     *
176
     * @param $attribute
177
     * @param $value
178
     * @param $parameters
179
     * @return mixed
180
     */
181
    public function validateIsbn($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
182
    {
183
        $this->requireParameterCount(1, $parameters, 'isbn');
184
        $type = Arr::get($this->data, $parameters[0]);
185
186
        return $this->runIsoCodesValidator(\IsoCodes\Isbn::class, $value, $type);
187
    }
188
189
    /**
190
     * Validate an "International Securities Identification Number" (ISIN)
191
     *
192
     * @param $attribute
193
     * @param $value
194
     * @param $parameters
195
     * @return mixed
196
     */
197
    public function validateIsin($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
198
    {
199
        return $this->runIsoCodesValidator(\IsoCodes\Isin::class, $value);
200
    }
201
202
    /**
203
     * Validate a MAC address
204
     *
205
     * @param $attribute
206
     * @param $value
207
     * @param $parameters
208
     * @return mixed
209
     */
210
    public function validateMac($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
211
    {
212
        return $this->runIsoCodesValidator(\IsoCodes\Mac::class, $value);
213
    }
214
215
    /**
216
     * Validate a "Número de Identificación Fiscal" (NIF)
217
     *
218
     * @param $attribute
219
     * @param $value
220
     * @param $parameters
221
     * @return mixed
222
     */
223
    public function validateNif($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
224
    {
225
        return $this->runIsoCodesValidator(\IsoCodes\Nif::class, $value);
226
    }
227
228
    /**
229
     * Validate a "Organisme Type12 Norme B2"
230
     *
231
     * @param $attribute
232
     * @param $value
233
     * @param $parameters
234
     * @return mixed
235
     */
236 View Code Duplication
    public function validateOrganismeType12NormeB2($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
237
    {
238
        $this->requireParameterCount(1, $parameters, 'organisme_type12_norme_b2');
239
        $clef = Arr::get($this->data, $parameters[0]);
240
241
        return $this->runIsoCodesValidator(\IsoCodes\OrganismeType12NormeB2::class, $value, $clef);
242
    }
243
244
    /**
245
     * Validate a phone number
246
     *
247
     * @param $attribute
248
     * @param $value
249
     * @param $parameters
250
     * @return mixed
251
     */
252 View Code Duplication
    public function validatePhonenumber($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
253
    {
254
        $this->requireParameterCount(1, $parameters, 'phonenumber');
255
        $country = Arr::get($this->data, $parameters[0]);
256
257
        return $this->runIsoCodesValidator(\IsoCodes\PhoneNumber::class, $value, $country);
258
    }
259
260
    /**
261
     * Validate a Stock Exchange Daily Official List (SEDOL)
262
     *
263
     * @param $attribute
264
     * @param $value
265
     * @param $parameters
266
     * @return mixed
267
     */
268
    public function validateSedol($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
269
    {
270
        return $this->runIsoCodesValidator(\IsoCodes\Sedol::class, $value);
271
    }
272
273
    /**
274
     * Validate "Système d’Identification du Répertoire des Entreprises" (SIREN)
275
     *
276
     * @param $attribute
277
     * @param $value
278
     * @param $parameters
279
     * @return mixed
280
     */
281
    public function validateSiren($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
282
    {
283
        return $this->runIsoCodesValidator(\IsoCodes\Siren::class, $value);
284
    }
285
286
    /**
287
     * Validate "Système d’Identification du Répertoire des ETablissements" (SIRET)
288
     *
289
     * @param $attribute
290
     * @param $value
291
     * @param $parameters
292
     * @return mixed
293
     */
294
    public function validateSiret($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
295
    {
296
        return $this->runIsoCodesValidator(\IsoCodes\Siret::class, $value);
297
    }
298
299
    /**
300
     * Validate a European/International Article Number (SSCC)
301
     *
302
     * @param $attribute
303
     * @param $value
304
     * @param $parameters
305
     * @return mixed
306
     */
307
    public function validateSscc($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
308
    {
309
        return $this->runIsoCodesValidator(\IsoCodes\Sscc::class, $value);
310
    }
311
312
    /**
313
     * Validate a Social Security Number (SSN)
314
     *
315
     * @param $attribute
316
     * @param $value
317
     * @param $parameters
318
     * @return mixed
319
     */
320
    public function validateSsn($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
321
    {
322
        return $this->runIsoCodesValidator(\IsoCodes\Ssn::class, $value);
323
    }
324
325
    /**
326
     * Validate structured communication
327
     *
328
     * @param $attribute
329
     * @param $value
330
     * @param $parameters
331
     * @return mixed
332
     */
333
    public function validateStructuredCommunication($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
334
    {
335
        return $this->runIsoCodesValidator(\IsoCodes\StructuredCommunication::class, $value);
336
    }
337
338
    /**
339
     * Validate a SWIFT/BIC
340
     *
341
     * @param $attribute
342
     * @param $value
343
     * @param $parameters
344
     * @return mixed
345
     */
346
    public function validateSwiftBic($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
347
    {
348
        return $this->runIsoCodesValidator(\IsoCodes\SwiftBic::class, $value);
349
    }
350
351
    /**
352
     * Validate a UK National Insurance Number
353
     *
354
     * @param $attribute
355
     * @param $value
356
     * @param $parameters
357
     * @return mixed
358
     */
359
    public function validateUknin($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
360
    {
361
        return $this->runIsoCodesValidator(\IsoCodes\Uknin::class, $value);
362
    }
363
364
    /**
365
     * Validate a Universal Product Code
366
     *
367
     * @param $attribute
368
     * @param $value
369
     * @param $parameters
370
     * @return mixed
371
     */
372
    public function validateUpca($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
373
    {
374
        return $this->runIsoCodesValidator(\IsoCodes\Upca::class, $value);
375
    }
376
377
    /**
378
     * Validate Value Added Tax (VAT)
379
     *
380
     * @param $attribute
381
     * @param $value
382
     * @param $parameters
383
     * @return mixed
384
     */
385
    public function validateVat($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameters is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
386
    {
387
        return $this->runIsoCodesValidator(\IsoCodes\Vat::class, $value);
388
    }
389
390
    /**
391
     * Validate a zip code
392
     *
393
     * @param $attribute
394
     * @param $value
395
     * @param $parameters
396
     * @return mixed
397
     */
398 View Code Duplication
    public function validateZipcode($attribute, $value, $parameters)
0 ignored issues
show
Unused Code introduced by
The parameter $attribute is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
399
    {
400
        $this->requireParameterCount(1, $parameters, 'zipcode');
401
        $country = Arr::get($this->data, $parameters[0]);
402
403
        return $this->runIsoCodesValidator(\IsoCodes\ZipCode::class, $value, $country);
404
    }
405
406
    /**
407
     * Execute the validation function
408
     * and catch every other Exception from underlying libraries
409
     * so we will only display the Laravel validation error
410
     *
411
     * @param $validator
412
     * @param $value
413
     * @param string $reference
414
     * @return mixed
415
     */
416
    protected function runIsoCodesValidator($validator, $value, $reference = '')
417
    {
418
        try {
419
            if (empty($reference)) {
420
                return call_user_func($validator . '::validate', $value);
421
            }
422
423
            return call_user_func($validator . '::validate', $value, $reference);
424
        } catch (Exception $e) {
425
            // do nothing
426
        }
427
    }
428
429
    /**
430
     * Replace all country place-holders
431
     *
432
     * @param $message
433
     * @param $parameter
434
     * @return mixed
435
     */
436
    protected function countryReplacer($message, $parameter)
437
    {
438
        return str_replace(':country', Arr::get($this->data, $parameter[0]), $message);
439
    }
440
441
    /**
442
     * Replace all value place-holders
443
     *
444
     * @param $message
445
     * @param $attribute
446
     * @return mixed
447
     */
448
    protected function valueReplacer($message, $attribute)
449
    {
450
        return str_replace(':value', $this->getValue($attribute), $message);
451
    }
452
453
    /**
454
     * Replace all place-holders for the bban rule
455
     *
456
     * @param $message
457
     * @param $attribute
458
     * @param $rule
459
     * @param $parameter
460
     * @return mixed
461
     */
462
    public function replaceBban($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
463
    {
464
        return $this->valueReplacer($message, $attribute);
465
    }
466
467
    /**
468
     * Replace all place-holders for the bsn rule
469
     *
470
     * @param $message
471
     * @param $attribute
472
     * @param $rule
473
     * @param $parameter
474
     * @return mixed
475
     */
476
    public function replaceBsn($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
477
    {
478
        return $this->valueReplacer($message, $attribute);
479
    }
480
481
    /**
482
     * Replace all place-holders for the cif rule
483
     *
484
     * @param $message
485
     * @param $attribute
486
     * @param $rule
487
     * @param $parameter
488
     * @return mixed
489
     */
490
    public function replaceCif($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
491
    {
492
        return $this->valueReplacer($message, $attribute);
493
    }
494
495
    /**
496
     * Replace all place-holders for the creditcard rule
497
     *
498
     * @param $message
499
     * @param $attribute
500
     * @param $rule
501
     * @param $parameter
502
     * @return mixed
503
     */
504
    public function replaceCreditcard($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
505
    {
506
        return $this->valueReplacer($message, $attribute);
507
    }
508
509
    /**
510
     * Replace all place-holders for the ena8 rule
511
     *
512
     * @param $message
513
     * @param $attribute
514
     * @param $rule
515
     * @param $parameter
516
     * @return mixed
517
     */
518
    public function replaceEan8($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
519
    {
520
        return $this->valueReplacer($message, $attribute);
521
    }
522
523
    /**
524
     * Replace all place-holders for the ean13 rule
525
     *
526
     * @param $message
527
     * @param $attribute
528
     * @param $rule
529
     * @param $parameter
530
     * @return mixed
531
     */
532
    public function replaceEan13($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
533
    {
534
        return $this->valueReplacer($message, $attribute);
535
    }
536
537
    /**
538
     * Replace all place-holders for the gitin8 rule
539
     *
540
     * @param $message
541
     * @param $attribute
542
     * @param $rule
543
     * @param $parameter
544
     * @return mixed
545
     */
546
    public function replaceGtin8($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
547
    {
548
        return $this->valueReplacer($message, $attribute);
549
    }
550
551
    /**
552
     * Replace all place-holders for the gtin12 rule
553
     *
554
     * @param $message
555
     * @param $attribute
556
     * @param $rule
557
     * @param $parameter
558
     * @return mixed
559
     */
560
    public function replaceGtin12($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
561
    {
562
        return $this->valueReplacer($message, $attribute);
563
    }
564
565
    /**
566
     * Replace all place-holders for the gtin13 rule
567
     *
568
     * @param $message
569
     * @param $attribute
570
     * @param $rule
571
     * @param $parameter
572
     * @return mixed
573
     */
574
    public function replaceGtin13($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
575
    {
576
        return $this->valueReplacer($message, $attribute);
577
    }
578
579
    /**
580
     * Replace all place-holders for the gtin14 rule
581
     *
582
     * @param $message
583
     * @param $attribute
584
     * @param $rule
585
     * @param $parameter
586
     * @return mixed
587
     */
588
    public function replaceGtin14($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
589
    {
590
        return $this->valueReplacer($message, $attribute);
591
    }
592
593
    /**
594
     * Replace all place-holders for the iban rule
595
     * 
596
     * @param $message
597
     * @param $attribute
598
     * @param $rule
599
     * @param $parameter
600
     * @return mixed
601
     */
602
    public function replaceIban($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
603
    {
604
        return $this->valueReplacer($message, $attribute);
605
    }
606
607
    /**
608
     * Replace all place-holders for the insee rule
609
     * 
610
     * @param $message
611
     * @param $attribute
612
     * @param $rule
613
     * @param $parameter
614
     * @return mixed
615
     */
616
    public function replaceInsee($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
617
    {
618
        return $this->valueReplacer($message, $attribute);
619
    }
620
621
    /**
622
     * Replace all place-holders for the ipaddress rule
623
     * 
624
     * @param $message
625
     * @param $attribute
626
     * @param $rule
627
     * @param $parameter
628
     * @return mixed
629
     */
630
    public function replaceIpaddress($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
631
    {
632
        return $this->valueReplacer($message, $attribute);
633
    }
634
635
    /**
636
     * Replace all place-holders for the isbn rule
637
     * 
638
     * @param $message
639
     * @param $attribute
640
     * @param $rule
641
     * @param $parameter
642
     * @return mixed
643
     */
644
    public function replaceIsbn($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
645
    {
646
        return $this->valueReplacer($message, $attribute);
647
    }
648
649
    /**
650
     * Replace all place-holders for the isin rule
651
     * 
652
     * @param $message
653
     * @param $attribute
654
     * @param $rule
655
     * @param $parameter
656
     * @return mixed
657
     */
658
    public function replaceIsin($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
659
    {
660
        return $this->valueReplacer($message, $attribute);
661
    }
662
663
    /**
664
     * Replace all place-holders for the mac rule
665
     * 
666
     * @param $message
667
     * @param $attribute
668
     * @param $rule
669
     * @param $parameter
670
     * @return mixed
671
     */
672
    public function replaceMac($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
673
    {
674
        return $this->valueReplacer($message, $attribute);
675
    }
676
677
    /**
678
     * Replace all place-holders for the nif rule
679
     * 
680
     * @param $message
681
     * @param $attribute
682
     * @param $rule
683
     * @param $parameter
684
     * @return mixed
685
     */
686
    public function replaceNif($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
687
    {
688
        return $this->valueReplacer($message, $attribute);
689
    }
690
691
    /**
692
     * Replace all place-holders for the organisme_type12_norme_b2 rule
693
     * 
694
     * @param $message
695
     * @param $attribute
696
     * @param $rule
697
     * @param $parameter
698
     * @return mixed
699
     */
700
    public function replaceOrganismeType12NormeB2($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
701
    {
702
        return $this->valueReplacer($message, $attribute);
703
    }
704
705
    /**
706
     * Replace all place-holders for the phonenumber rule
707
     * 
708
     * @param $message
709
     * @param $attribute
710
     * @param $rule
711
     * @param $parameter
712
     * @return mixed
713
     */
714
    protected function replacePhonenumber($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
715
    {
716
        $message = $this->valueReplacer($message, $attribute);
717
        $message = $this->countryReplacer($message, $parameter);
718
719
        return $message;
720
    }
721
722
    /**
723
     * Replace all place-holders for the sedol rule
724
     * 
725
     * @param $message
726
     * @param $attribute
727
     * @param $rule
728
     * @param $parameter
729
     * @return mixed
730
     */
731
    public function replaceSedol($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
732
    {
733
        return $this->valueReplacer($message, $attribute);
734
    }
735
736
    /**
737
     * Replace all place-holders for the siren rule
738
     * 
739
     * @param $message
740
     * @param $attribute
741
     * @param $rule
742
     * @param $parameter
743
     * @return mixed
744
     */
745
    public function replaceSiren($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
746
    {
747
        return $this->valueReplacer($message, $attribute);
748
    }
749
750
    /**
751
     * Replace all place-holders for the siret rule
752
     * 
753
     * @param $message
754
     * @param $attribute
755
     * @param $rule
756
     * @param $parameter
757
     * @return mixed
758
     */
759
    public function replaceSiret($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
760
    {
761
        return $this->valueReplacer($message, $attribute);
762
    }
763
764
    /**
765
     * Replace all place-holders for the sscc rule
766
     * 
767
     * @param $message
768
     * @param $attribute
769
     * @param $rule
770
     * @param $parameter
771
     * @return mixed
772
     */
773
    public function replaceSscc($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
774
    {
775
        return $this->valueReplacer($message, $attribute);
776
    }
777
778
    /**
779
     * Replace all place-holders for the ssn rule
780
     * 
781
     * @param $message
782
     * @param $attribute
783
     * @param $rule
784
     * @param $parameter
785
     * @return mixed
786
     */
787
    public function replaceSSn($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
788
    {
789
        return $this->valueReplacer($message, $attribute);
790
    }
791
792
    /**
793
     * Replace all place-holders for the structured_communication rule
794
     * 
795
     * @param $message
796
     * @param $attribute
797
     * @param $rule
798
     * @param $parameter
799
     * @return mixed
800
     */
801
    public function replaceStructuredCommunication($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
802
    {
803
        return $this->valueReplacer($message, $attribute);
804
    }
805
806
    /**
807
     * Replace all place-holders for the swift_bic rule
808
     * 
809
     * @param $message
810
     * @param $attribute
811
     * @param $rule
812
     * @param $parameter
813
     * @return mixed
814
     */
815
    public function replaceSwiftBic($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
816
    {
817
        return $this->valueReplacer($message, $attribute);
818
    }
819
820
    /**
821
     * Replace all place-holders for the zipcode rule
822
     * 
823
     * @param $message
824
     * @param $attribute
825
     * @param $rule
826
     * @param $parameter
827
     * @return mixed
828
     */
829
    public function replaceZipcode($message, $attribute, $rule, $parameter)
0 ignored issues
show
Unused Code introduced by
The parameter $rule is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
830
    {
831
        $message = $this->valueReplacer($message, $attribute);
832
        $message = $this->countryReplacer($message, $parameter);
833
834
        return $message;
835
    }
836
}
837