1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Orumad\SpanishValidator; |
4
|
|
|
|
5
|
|
|
class InternalValidator |
6
|
|
|
{ |
7
|
|
|
protected $validator; |
8
|
|
|
|
9
|
|
|
public function __construct() |
10
|
|
|
{ |
11
|
|
|
$this->validator = new Validator(); |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function validateTaxNumber($attribute, $value, $parameters, $validator) |
|
|
|
|
15
|
|
|
{ |
16
|
|
|
return $this->validator->isValidTaxNumber($value); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
public function validatePersonalId($attribute, $value, $parameters, $validator) |
|
|
|
|
20
|
|
|
{ |
21
|
|
|
return $this->validator->isValidPersonalId($value); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function validateNif($attribute, $value, $parameters, $validator) |
|
|
|
|
25
|
|
|
{ |
26
|
|
|
return $this->validator->isValidNif($value); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function validateNie($attribute, $value, $parameters, $validator) |
|
|
|
|
30
|
|
|
{ |
31
|
|
|
return $this->validator->isValidNie($value); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function validateCif($attribute, $value, $parameters, $validator) |
|
|
|
|
35
|
|
|
{ |
36
|
|
|
return $this->validator->isValidCif($value); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function validateNss($attribute, $value, $parameters, $validator) |
|
|
|
|
40
|
|
|
{ |
41
|
|
|
return $this->validator->isValidNss($value); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function validateIban($attribute, $value, $parameters, $validator) |
|
|
|
|
45
|
|
|
{ |
46
|
|
|
return $this->validator->isValidIban($value); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function validatePostalCode($attribute, $value, $parameters, $validator) |
|
|
|
|
50
|
|
|
{ |
51
|
|
|
return $this->validator->isValidPostalCode($value); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function validatePhone($attribute, $value, $parameters, $validator) |
|
|
|
|
55
|
|
|
{ |
56
|
|
|
return $this->validator->isValidPhone($value); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.