@@ -50,8 +50,7 @@ |
||
50 | 50 | * A generic Rule that asserts whether the given validation |
51 | 51 | * data is valid or not. |
52 | 52 | */ |
53 | -interface RuleInterface |
|
54 | -{ |
|
53 | +interface RuleInterface { |
|
55 | 54 | |
56 | 55 | /** |
57 | 56 | * Method to validate this Rule |
@@ -32,7 +32,6 @@ |
||
32 | 32 | |
33 | 33 | namespace Platine\Validator\Exception; |
34 | 34 | |
35 | -class ValidatorException extends \Exception |
|
36 | -{ |
|
35 | +class ValidatorException extends \Exception { |
|
37 | 36 | |
38 | 37 | } |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | * associated metadata for ensuring that a given dataset |
54 | 54 | * is valid and returned correctly. |
55 | 55 | */ |
56 | -class Validator |
|
57 | -{ |
|
56 | +class Validator { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * The data to validate |
@@ -92,8 +91,7 @@ discard block |
||
92 | 91 | */ |
93 | 92 | protected bool $valid = false; |
94 | 93 | |
95 | - public function __construct() |
|
96 | - { |
|
94 | + public function __construct() { |
|
97 | 95 | $this->reset(); |
98 | 96 | } |
99 | 97 | |
@@ -133,8 +131,7 @@ discard block |
||
133 | 131 | * @param mixed $default the default value to return if can not find field value |
134 | 132 | * @return mixed |
135 | 133 | */ |
136 | - public function getData(?string $field = null, $default = null) |
|
137 | - { |
|
134 | + public function getData(?string $field = null, $default = null) { |
|
138 | 135 | if ($field === null) { |
139 | 136 | return $this->data; |
140 | 137 | } |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class Date implements RuleInterface |
|
53 | -{ |
|
52 | +class Date implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * The date format to validate |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * Constructor |
63 | 62 | * @param string $format the date format |
64 | 63 | */ |
65 | - public function __construct(string $format) |
|
66 | - { |
|
64 | + public function __construct(string $format) { |
|
67 | 65 | $this->format = $format; |
68 | 66 | } |
69 | 67 |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class Range implements RuleInterface |
|
53 | -{ |
|
52 | +class Range implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * Minimum Value to compare against |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | * @param mixed $min the minimum value to compare against |
70 | 69 | * @param mixed $max the maximum value to compare against |
71 | 70 | */ |
72 | - public function __construct($min, $max) |
|
73 | - { |
|
71 | + public function __construct($min, $max) { |
|
74 | 72 | $this->min = $min; |
75 | 73 | $this->max = $max; |
76 | 74 | } |
@@ -49,8 +49,7 @@ |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class AlphaNumericDash implements RuleInterface |
|
53 | -{ |
|
52 | +class AlphaNumericDash implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * String pattern to allow |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class NotEqual implements RuleInterface |
|
53 | -{ |
|
52 | +class NotEqual implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * Value to compare against |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * Constructor |
63 | 62 | * @param mixed $value the value to compare against |
64 | 63 | */ |
65 | - public function __construct($value) |
|
66 | - { |
|
64 | + public function __construct($value) { |
|
67 | 65 | $this->value = $value; |
68 | 66 | } |
69 | 67 |
@@ -49,8 +49,7 @@ |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class Integer implements RuleInterface |
|
53 | -{ |
|
52 | +class Integer implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * {@inheritdoc} |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | use Platine\Validator\RuleInterface; |
50 | 50 | use Platine\Validator\Validator; |
51 | 51 | |
52 | -class Regex implements RuleInterface |
|
53 | -{ |
|
52 | +class Regex implements RuleInterface { |
|
54 | 53 | |
55 | 54 | /** |
56 | 55 | * The regex pattern |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * Constructor |
63 | 62 | * @param string $regex the regex pattern |
64 | 63 | */ |
65 | - public function __construct(string $regex) |
|
66 | - { |
|
64 | + public function __construct(string $regex) { |
|
67 | 65 | $this->regex = $regex; |
68 | 66 | } |
69 | 67 |