Passed
Push — develop ( 58cba6...dd1d01 )
by nguereza
12:49
created
src/RuleInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
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
      * Method to validate this Rule
57 56
      *
Please login to merge, or discard this patch.
src/Rule/Password.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
             'lowercase' => false,
85 85
             'number' => false,
86 86
             'special_chars' => false,
87
-           ], $rules);
87
+            ], $rules);
88 88
     }
89 89
 
90 90
     /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,25 +105,25 @@
 block discarded – undo
105 105
             return false;
106 106
         }
107 107
 
108
-        if ($rules['uppercase'] && ((bool)preg_match('~[A-Z]~', $value)) === false) {
108
+        if ($rules['uppercase'] && ((bool) preg_match('~[A-Z]~', $value)) === false) {
109 109
             $this->errorType = self::ERROR_TYPE_UPPERCASE;
110 110
 
111 111
             return false;
112 112
         }
113 113
 
114
-        if ($rules['lowercase'] && ((bool)preg_match('~[a-z]~', $value)) === false) {
114
+        if ($rules['lowercase'] && ((bool) preg_match('~[a-z]~', $value)) === false) {
115 115
             $this->errorType = self::ERROR_TYPE_LOWERCASE;
116 116
 
117 117
             return false;
118 118
         }
119 119
 
120
-        if ($rules['number'] && ((bool)preg_match('~[0-9]~', $value)) === false) {
120
+        if ($rules['number'] && ((bool) preg_match('~[0-9]~', $value)) === false) {
121 121
             $this->errorType = self::ERROR_TYPE_NUMBER;
122 122
 
123 123
             return false;
124 124
         }
125 125
 
126
-        if ($rules['special_chars'] && ((bool)preg_match('~[^\w]~', $value)) === false) {
126
+        if ($rules['special_chars'] && ((bool) preg_match('~[^\w]~', $value)) === false) {
127 127
             $this->errorType = self::ERROR_TYPE_SPECIAL_CHAR;
128 128
 
129 129
             return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class Password
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class Password implements RuleInterface
57
-{
56
+class Password implements RuleInterface {
58 57
     /*
59 58
      * The error type list
60 59
      */
@@ -80,8 +79,7 @@  discard block
 block discarded – undo
80 79
      * Constructor
81 80
      * @param array<string, bool|int> $rules
82 81
      */
83
-    public function __construct(array $rules = [])
84
-    {
82
+    public function __construct(array $rules = []) {
85 83
         $this->rules = array_merge([
86 84
             'length' => 5,
87 85
             'uppercase' => false,
Please login to merge, or discard this patch.
src/Validator.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * associated metadata for ensuring that a given data set
57 57
  * is valid and returned correctly.
58 58
  */
59
-class Validator
60
-{
59
+class Validator {
61 60
     /**
62 61
      * The data to validate
63 62
      * @var array<string, mixed>
@@ -112,8 +111,7 @@  discard block
 block discarded – undo
112 111
      * @param Lang $lang
113 112
      * @param string $langDomain
114 113
      */
115
-    public function __construct(Lang $lang, string $langDomain = 'validators')
116
-    {
114
+    public function __construct(Lang $lang, string $langDomain = 'validators') {
117 115
         $this->lang = $lang;
118 116
         $this->langDomain = $langDomain;
119 117
 
Please login to merge, or discard this patch.
src/Exception/ValidatorException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,6 +38,5 @@
 block discarded – undo
38 38
  * @class ValidatorException
39 39
  * @package Platine\Validator\Exception
40 40
  */
41
-class ValidatorException extends Exception
42
-{
41
+class ValidatorException extends Exception {
43 42
 }
Please login to merge, or discard this patch.
src/Rule/AlphaNumericDash.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @class AlphaNumericDash
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class AlphaNumericDash implements RuleInterface
57
-{
56
+class AlphaNumericDash implements RuleInterface {
58 57
     /**
59 58
      * String pattern to allow
60 59
      * @var string
Please login to merge, or discard this patch.
src/Rule/Max.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,13 +59,13 @@
 block discarded – undo
59 59
      * Value to compare against
60 60
      * @var string|float|int|bool|null
61 61
      */
62
-    protected string|float|int|bool|null $value;
62
+    protected string | float | int | bool | null $value;
63 63
 
64 64
     /**
65 65
      * Constructor
66 66
      * @param string|float|int|bool|null $value the value to compare against
67 67
      */
68
-    public function __construct(string|float|int|bool|null $value)
68
+    public function __construct(string | float | int | bool | null $value)
69 69
     {
70 70
         $this->value = $value;
71 71
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class Max
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class Max implements RuleInterface
57
-{
56
+class Max implements RuleInterface {
58 57
     /**
59 58
      * Value to compare against
60 59
      * @var string|float|int|bool|null
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      * Constructor
66 65
      * @param string|float|int|bool|null $value the value to compare against
67 66
      */
68
-    public function __construct(string|float|int|bool|null $value)
69
-    {
67
+    public function __construct(string|float|int|bool|null $value) {
70 68
         $this->value = $value;
71 69
     }
72 70
 
Please login to merge, or discard this patch.
src/Rule/DateBefore.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class DateBefore
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class DateBefore implements RuleInterface
57
-{
56
+class DateBefore implements RuleInterface {
58 57
     /**
59 58
      * The date to compare against
60 59
      * @var string
@@ -72,8 +71,7 @@  discard block
 block discarded – undo
72 71
      * @param string $date the date format
73 72
      * @param bool $include
74 73
      */
75
-    public function __construct(string $date, bool $include = false)
76
-    {
74
+    public function __construct(string $date, bool $include = false) {
77 75
         $this->date = $date;
78 76
         $this->include = $include;
79 77
     }
Please login to merge, or discard this patch.
src/Rule/InList.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class InList
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class InList implements RuleInterface
57
-{
56
+class InList implements RuleInterface {
58 57
     /**
59 58
      * The list to match
60 59
      * @var array<mixed>
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      * Constructor
66 65
      * @param array<mixed> $list
67 66
      */
68
-    public function __construct(array $list)
69
-    {
67
+    public function __construct(array $list) {
70 68
         $this->list = $list;
71 69
     }
72 70
 
Please login to merge, or discard this patch.
src/Rule/NotEqual.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class NotEqual
54 54
  * @package Platine\Validator\Rule
55 55
  */
56
-class NotEqual implements RuleInterface
57
-{
56
+class NotEqual implements RuleInterface {
58 57
     /**
59 58
      * Value to compare against
60 59
      * @var mixed
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      * Constructor
66 65
      * @param mixed $value the value to compare against
67 66
      */
68
-    public function __construct(mixed $value)
69
-    {
67
+    public function __construct(mixed $value) {
70 68
         $this->value = $value;
71 69
     }
72 70
 
Please login to merge, or discard this patch.