Passed
Push — master ( 623d43...242e5d )
by
unknown
03:09 queued 01:24
created
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.
src/FrontQL/Adapter/Select/SelectPayload.php 1 patch
Spacing   +11 added lines, -11 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'];
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function getOffset()
83 83
     {
84
-        if(!isset($this->payload['offset']))
84
+        if (!isset($this->payload['offset']))
85 85
             return null;
86 86
 
87
-        if(!is_int($this->payload['offset']))
87
+        if (!is_int($this->payload['offset']))
88 88
             return null;
89 89
 
90 90
         return $this->payload['offset'];
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
     {
100 100
         $allowed = ['ASC', 'DESC'];
101 101
 
102
-        if(!isset($this->payload['order']) || !is_array($this->payload['order']))
102
+        if (!isset($this->payload['order']) || !is_array($this->payload['order']))
103 103
             return '';
104 104
 
105 105
         $orders = array();
106 106
 
107
-        foreach ($this->payload['order'] as $order){
107
+        foreach ($this->payload['order'] as $order) {
108 108
             $columns  = implode(', ', $order[0]);
109 109
             $command  = in_array($order[1], $allowed) ? $order[1] : 'ASC';
110 110
             $orders[] = "{$columns}, {$command}";
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function getWhere()
122 122
     {
123
-        if(!is_array($this->payload['where']))
123
+        if (!is_array($this->payload['where']))
124 124
             return [];
125 125
 
126 126
         $adapter = new WhereAdapter();
Please login to merge, or discard this patch.
src/FrontQL/Adapter/Select/SelectAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 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;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         // Adapta o payload ao padrão do zend
81 81
         $select = new Select();
82 82
 
83
-        if(!is_null($this->getSelectPayload()->getOrder()))
83
+        if (!is_null($this->getSelectPayload()->getOrder()))
84 84
             $select->order($this->getSelectPayload()->getOrder());
85 85
 
86 86
         $select->columns($columns);
Please login to merge, or discard this patch.