Passed
Push — master ( 3cdc48...9aa249 )
by
unknown
02:20
created
src/FrontQL/Adapter/Select/SelectPayload.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     public function getColumns()
39 39
     {
40 40
         // Se nenhuma coluna foi definida todas serão retornadas
41
-        if(!isset($this->payload['columns']) || !is_array($this->payload['columns']))
41
+        if (!isset($this->payload['columns']) || !is_array($this->payload['columns']))
42 42
             return ['*'];
43 43
 
44 44
         $regex = '/^[a-zA-Z_][a-zA-Z0-9_]*$/';
45 45
         $columns = array();
46 46
 
47
-        foreach ($this->payload['columns'] as $column){
47
+        foreach ($this->payload['columns'] as $column) {
48 48
             // Valida o nome da coluna
49
-            if(!is_string($column) || !preg_match($regex, $column))
49
+            if (!is_string($column) || !preg_match($regex, $column))
50 50
                 throw new InvalidColumnNameException();
51 51
 
52 52
             $columns[] = $column;
53 53
         }
54 54
 
55
-        if(count($columns) == 0)
55
+        if (count($columns) == 0)
56 56
             return ['*'];
57 57
 
58 58
         return $columns;
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function getLimit()
67 67
     {
68
-        if(!isset($this->payload['limit']))
68
+        if (!isset($this->payload['limit']))
69 69
             return null;
70 70
 
71
-        if(!is_int($this->payload['limit']))
71
+        if (!is_int($this->payload['limit']))
72 72
             return null;
73 73
 
74 74
         return $this->payload['limit'];
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $allowed = ['ASC', 'DESC'];
85 85
 
86
-        if(!isset($this->payload['order']) || !is_array($this->payload['order']))
86
+        if (!isset($this->payload['order']) || !is_array($this->payload['order']))
87 87
             return '';
88 88
 
89 89
         $orders = array();
90 90
 
91
-        foreach ($this->payload['order'] as $order){
91
+        foreach ($this->payload['order'] as $order) {
92 92
             $columns  = implode(', ', $order[0]);
93 93
             $command  = in_array($order[1], $allowed) ? $order[1] : 'ASC';
94 94
             $orders[] = "{$columns}, {$command}";
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function getWhere()
106 106
     {
107
-        if(!is_array($this->payload['where']))
107
+        if (!is_array($this->payload['where']))
108 108
             return [];
109 109
 
110 110
         $adapter = new WhereAdapter();
Please login to merge, or discard this patch.
src/FrontQL/Adapter/Select/SelectAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
      */
53 53
     public function getProtectedColumns()
54 54
     {
55
-        if(is_null($this->protectedColumns))
55
+        if (is_null($this->protectedColumns))
56 56
             $this->protectedColumns = [];
57 57
 
58 58
         return $this->protectedColumns;
Please login to merge, or discard this patch.
src/FrontQL/Adapter/Where/WhereAdapter.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,17 +54,17 @@
 block discarded – undo
54 54
     public function fromArray(array $jWhere)
55 55
     {
56 56
         $where = new Where();
57
-        foreach($jWhere as $item){
58
-            if(is_array($item)){
59
-                if(!in_array($item[0], $this->allowed)) {
57
+        foreach ($jWhere as $item) {
58
+            if (is_array($item)) {
59
+                if (!in_array($item[0], $this->allowed)) {
60 60
                     throw new InvalidCommandException();
61 61
                 }
62 62
                 $method = $item[0];
63 63
                 unset($item[0]);
64 64
                 call_user_func_array([$where, $method], $item);
65 65
             }
66
-            if(is_string($item)){
67
-                if(in_array($item, $this->allowed))
66
+            if (is_string($item)) {
67
+                if (in_array($item, $this->allowed))
68 68
                     call_user_func([$where, $item]);
69 69
             }
70 70
         }
Please login to merge, or discard this patch.