Passed
Push — master ( ba00c7...bfa3fc )
by Sebastian
08:42
created
src/Request/Param/Filter/CommaSeparated.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
      */
27 27
     protected function _filter() : array
28 28
     {
29
-        if(is_array($this->value)) {
29
+        if (is_array($this->value)) {
30 30
             return $this->value;
31 31
         }
32 32
         
33
-        if($this->value === '' || !is_string($this->value)) {
33
+        if ($this->value === '' || !is_string($this->value)) {
34 34
             return array();
35 35
         }
36 36
         
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
         $stripEmptyEntries = $this->getBoolOption('stripEmptyEntries');
39 39
         $result = explode(',', $this->value);
40 40
         
41
-        if(!$trimEntries && !$stripEmptyEntries) {
41
+        if (!$trimEntries && !$stripEmptyEntries) {
42 42
             return $result;
43 43
         }
44 44
         
45 45
         $keep = array();
46 46
         
47
-        foreach($result as $entry)
47
+        foreach ($result as $entry)
48 48
         {
49
-            if($trimEntries === true) {
49
+            if ($trimEntries === true) {
50 50
                 $entry = trim($entry);
51 51
             }
52 52
             
53
-            if($stripEmptyEntries === true && $entry === '') {
53
+            if ($stripEmptyEntries === true && $entry === '') {
54 54
                 continue;
55 55
             }
56 56
             
Please login to merge, or discard this patch.
src/Request/Param/Validator/Enum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     protected function _validate()
34 34
     {
35
-        if(in_array($this->value, $this->getArrayOption('values'), true)) {
35
+        if (in_array($this->value, $this->getArrayOption('values'), true)) {
36 36
             return $this->value;
37 37
         }
38 38
         
Please login to merge, or discard this patch.
src/Request/Param/Validator/Integer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     
31 31
     protected function _validate() : ?int
32 32
     {
33
-        if(ConvertHelper::isInteger($this->value)) {
33
+        if (ConvertHelper::isInteger($this->value)) {
34 34
             return (int)$this->value;
35 35
         }
36 36
         
Please login to merge, or discard this patch.
src/Request/Param/Validator/Alpha.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
     
28 28
     protected function _validate() : ?string
29 29
     {
30
-        if(!is_scalar($this->value)) {
30
+        if (!is_scalar($this->value)) {
31 31
             return null;
32 32
         }
33 33
 
34 34
         $value = (string)$this->value;
35 35
         
36
-        if(preg_match('/\A[a-zA-Z]+\z/', $value)) {
36
+        if (preg_match('/\A[a-zA-Z]+\z/', $value)) {
37 37
             return $value;
38 38
         }
39 39
         
Please login to merge, or discard this patch.
src/Request/Param/Validator/Valueslist.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,22 +36,22 @@
 block discarded – undo
36 36
         
37 37
         // if we are validating a subvalue, it means we are 
38 38
         // validating a single value in the existing list.
39
-        if($this->isSubvalue) 
39
+        if ($this->isSubvalue) 
40 40
         {
41
-            if(in_array($this->value, $allowed, true)) {
41
+            if (in_array($this->value, $allowed, true)) {
42 42
                 return $this->value;
43 43
             }
44 44
             
45 45
             return null;
46 46
         }
47 47
         
48
-        if(!is_array($this->value)) {
48
+        if (!is_array($this->value)) {
49 49
             return array();
50 50
         }
51 51
         
52 52
         $keep = array();
53
-        foreach($this->value as $item) {
54
-            if(in_array($item, $allowed, true)) {
53
+        foreach ($this->value as $item) {
54
+            if (in_array($item, $allowed, true)) {
55 55
                 $keep[] = $item;
56 56
             }
57 57
         }
Please login to merge, or discard this patch.
src/Request/Param/Validator/Regex.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     
28 28
     protected function _validate() : ?string
29 29
     {
30
-        if(!is_scalar($this->value)) {
30
+        if (!is_scalar($this->value)) {
31 31
             return null;
32 32
         }
33 33
         
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
         // is a boolean, which is converted to an integer when
36 36
         // converted to string, which in turn can be validated
37 37
         // with a regex.
38
-        if(is_bool($this->value)) {
38
+        if (is_bool($this->value)) {
39 39
             return null;
40 40
         }
41 41
         
42 42
         $value = (string)$this->value;
43 43
         
44
-        if(preg_match($this->getStringOption('regex'), $value)) {
44
+        if (preg_match($this->getStringOption('regex'), $value)) {
45 45
             return $value;
46 46
         }
47 47
         
Please login to merge, or discard this patch.
src/Request/Param/Validator/Url.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
     
28 28
     protected function _validate() : string
29 29
     {
30
-        if(!is_string($this->value)) {
30
+        if (!is_string($this->value)) {
31 31
             return '';
32 32
         }
33 33
         
34 34
         $info = parseURL($this->value);
35
-        if($info->isValid()) {
35
+        if ($info->isValid()) {
36 36
             return $this->value;
37 37
         }
38 38
         
Please login to merge, or discard this patch.
src/Request/Param/Validator/Json.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
     
32 32
     protected function _validate() : string
33 33
     {
34
-        if(!is_string($this->value)) {
34
+        if (!is_string($this->value)) {
35 35
             return '';
36 36
         }
37 37
         
38 38
         $value = trim($this->value);
39 39
         
40
-        if(empty($value)) {
40
+        if (empty($value)) {
41 41
             return '';
42 42
         }
43 43
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,13 +50,11 @@
 block discarded – undo
50 50
                 {
51 51
                     return $value;
52 52
                 }
53
-            }
54
-            else if (is_array(json_decode($value, true, 512, JSON_THROW_ON_ERROR)))
53
+            } else if (is_array(json_decode($value, true, 512, JSON_THROW_ON_ERROR)))
55 54
             {
56 55
                 return $value;
57 56
             }
58
-        }
59
-        catch (Throwable $e)
57
+        } catch (Throwable $e)
60 58
         {
61 59
             // Invalid JSON must return an empty string.
62 60
             // The application is responsible for asserting
Please login to merge, or discard this patch.
src/Request/Param/Validator/Numeric.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     protected function _validate()
32 32
     {
33
-        if(is_numeric($this->value)) {
33
+        if (is_numeric($this->value)) {
34 34
             return $this->value * 1;
35 35
         }
36 36
         
Please login to merge, or discard this patch.