Passed
Push — master ( d44413...7ff405 )
by Adrian
04:24
created
src/Traits/SetFields.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
      * @param $fieldValue
23 23
      * @return $this
24 24
      */
25
-    public function setField($fieldName, $fieldValue)
25
+    public function setField( $fieldName, $fieldValue )
26 26
     {
27
-        $valuePdoString = $this->queryStructure->bindParam($fieldName, $fieldValue);
28
-        $this->queryStructure->setElement(QueryStructure::SET_FIELDS, "$fieldName = $valuePdoString");
27
+        $valuePdoString = $this->queryStructure->bindParam( $fieldName, $fieldValue );
28
+        $this->queryStructure->setElement( QueryStructure::SET_FIELDS, "$fieldName = $valuePdoString" );
29 29
 
30 30
         return $this;
31 31
     }
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
      * @param string $expression
35 35
      * @return $this
36 36
      */
37
-    public function setFieldByExpression($expression)
37
+    public function setFieldByExpression( $expression )
38 38
     {
39
-        $this->queryStructure->setElement(QueryStructure::SET_FIELDS, $expression);
39
+        $this->queryStructure->setElement( QueryStructure::SET_FIELDS, $expression );
40 40
 
41 41
         return $this;
42 42
     }
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
      * @param array $updateFieldsArray
47 47
      * @return $this
48 48
      */
49
-    public function setFieldsByArray(array $updateFieldsArray)
49
+    public function setFieldsByArray( array $updateFieldsArray )
50 50
     {
51
-        foreach ($updateFieldsArray as $fieldName => $fieldValue)
52
-            $this->setField($fieldName, $fieldValue);
51
+        foreach ( $updateFieldsArray as $fieldName => $fieldValue )
52
+            $this->setField( $fieldName, $fieldValue );
53 53
 
54 54
         return $this;
55 55
     }
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
      */
60 60
     private function getSettingFieldsSyntax()
61 61
     {
62
-        if (!count($this->queryStructure->getElement(QueryStructure::SET_FIELDS)))
62
+        if ( !count( $this->queryStructure->getElement( QueryStructure::SET_FIELDS ) ) )
63 63
             return '';
64 64
 
65
-        return 'SET ' . implode(', ', $this->queryStructure->getElement(QueryStructure::SET_FIELDS));
65
+        return 'SET ' . implode( ', ', $this->queryStructure->getElement( QueryStructure::SET_FIELDS ) );
66 66
     }
67 67
 
68 68
 }
69 69
\ No newline at end of file
Please login to merge, or discard this patch.
src/Traits/OrderBy.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
      * @return $this
25 25
      * @throws QueryException
26 26
      */
27
-    public function orderBy($column, array $allowedColumns = [])
27
+    public function orderBy( $column, array $allowedColumns = [ ] )
28 28
     {
29
-        $column = trim($column);
29
+        $column = trim( $column );
30 30
 
31
-        if (!$this->validateColumn($column, $allowedColumns))
32
-            throw new QueryException('Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME);
31
+        if ( !$this->validateColumn( $column, $allowedColumns ) )
32
+            throw new QueryException( 'Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME );
33 33
 
34
-        $this->queryStructure->setElement(QueryStructure::ORDER_BY, $column);
34
+        $this->queryStructure->setElement( QueryStructure::ORDER_BY, $column );
35 35
 
36 36
         return $this;
37 37
     }
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
      * @return $this
44 44
      * @throws QueryException
45 45
      */
46
-    public function orderByDesc($column, array $allowedColumns = [])
46
+    public function orderByDesc( $column, array $allowedColumns = [ ] )
47 47
     {
48
-        $column = trim($column);
48
+        $column = trim( $column );
49 49
 
50
-        if (!$this->validateColumn($column, $allowedColumns))
51
-            throw new QueryException('Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME);
50
+        if ( !$this->validateColumn( $column, $allowedColumns ) )
51
+            throw new QueryException( 'Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME );
52 52
 
53
-        $this->queryStructure->setElement(QueryStructure::ORDER_BY, $column . ' DESC');
53
+        $this->queryStructure->setElement( QueryStructure::ORDER_BY, $column . ' DESC' );
54 54
 
55 55
         return $this;
56 56
     }
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
      * @param $expression
61 61
      * @return $this
62 62
      */
63
-    public function orderByExpression($expression)
63
+    public function orderByExpression( $expression )
64 64
     {
65
-        $this->queryStructure->setElement(QueryStructure::ORDER_BY, $expression);
65
+        $this->queryStructure->setElement( QueryStructure::ORDER_BY, $expression );
66 66
 
67 67
         return $this;
68 68
     }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
      */
74 74
     private function getOrderBySyntax()
75 75
     {
76
-        if (count($this->queryStructure->getElement(QueryStructure::ORDER_BY)))
77
-            return 'ORDER BY ' . QueryHelper::implode($this->queryStructure->getElement(QueryStructure::ORDER_BY), ', ');
76
+        if ( count( $this->queryStructure->getElement( QueryStructure::ORDER_BY ) ) )
77
+            return 'ORDER BY ' . QueryHelper::implode( $this->queryStructure->getElement( QueryStructure::ORDER_BY ), ', ' );
78 78
 
79 79
         return '';
80 80
     }
Please login to merge, or discard this patch.
src/Traits/Join.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
      * @param null $onRight
24 24
      * @return $this
25 25
      */
26
-    public function innerJoin($tableJoin, $onLeft, $onRight = null)
26
+    public function innerJoin( $tableJoin, $onLeft, $onRight = null )
27 27
     {
28
-        return $this->makeJoin('INNER JOIN', $tableJoin, $onLeft, $onRight);
28
+        return $this->makeJoin( 'INNER JOIN', $tableJoin, $onLeft, $onRight );
29 29
     }
30 30
 
31 31
     /**
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
      * @param null $onRight
35 35
      * @return $this
36 36
      */
37
-    public function leftJoin($tableJoin, $onLeft, $onRight = null)
37
+    public function leftJoin( $tableJoin, $onLeft, $onRight = null )
38 38
     {
39
-        return $this->makeJoin('LEFT JOIN', $tableJoin, $onLeft, $onRight);
39
+        return $this->makeJoin( 'LEFT JOIN', $tableJoin, $onLeft, $onRight );
40 40
     }
41 41
 
42 42
     /**
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
      * @param null $onRight
46 46
      * @return $this
47 47
      */
48
-    public function leftOuterJoin($tableJoin, $onLeft, $onRight = null)
48
+    public function leftOuterJoin( $tableJoin, $onLeft, $onRight = null )
49 49
     {
50
-        return $this->makeJoin('LEFT OUTER JOIN', $tableJoin, $onLeft, $onRight);
50
+        return $this->makeJoin( 'LEFT OUTER JOIN', $tableJoin, $onLeft, $onRight );
51 51
     }
52 52
 
53 53
     /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      * @param null $onRight
57 57
      * @return $this
58 58
      */
59
-    public function rightJoin($tableJoin, $onLeft, $onRight = null)
59
+    public function rightJoin( $tableJoin, $onLeft, $onRight = null )
60 60
     {
61
-        return $this->makeJoin('RIGHT JOIN', $tableJoin, $onLeft, $onRight);
61
+        return $this->makeJoin( 'RIGHT JOIN', $tableJoin, $onLeft, $onRight );
62 62
     }
63 63
 
64 64
     /**
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      * @param null $onRight
68 68
      * @return $this
69 69
      */
70
-    public function rightOuterJoin($tableJoin, $onLeft, $onRight = null)
70
+    public function rightOuterJoin( $tableJoin, $onLeft, $onRight = null )
71 71
     {
72
-        return $this->makeJoin('RIGHT OUTER JOIN', $tableJoin, $onLeft, $onRight);
72
+        return $this->makeJoin( 'RIGHT OUTER JOIN', $tableJoin, $onLeft, $onRight );
73 73
     }
74 74
 
75 75
     /**
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
      * @param null $onRight
79 79
      * @return $this
80 80
      */
81
-    public function fullJoin($tableJoin, $onLeft, $onRight = null)
81
+    public function fullJoin( $tableJoin, $onLeft, $onRight = null )
82 82
     {
83
-        return $this->makeJoin('FULL JOIN', $tableJoin, $onLeft, $onRight);
83
+        return $this->makeJoin( 'FULL JOIN', $tableJoin, $onLeft, $onRight );
84 84
     }
85 85
 
86 86
     /**
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
      * @param null $onRight
90 90
      * @return $this
91 91
      */
92
-    public function fullOuterJoin($tableJoin, $onLeft, $onRight = null)
92
+    public function fullOuterJoin( $tableJoin, $onLeft, $onRight = null )
93 93
     {
94
-        return $this->makeJoin('FULL OUTER JOIN', $tableJoin, $onLeft, $onRight);
94
+        return $this->makeJoin( 'FULL OUTER JOIN', $tableJoin, $onLeft, $onRight );
95 95
     }
96 96
 
97 97
     /**
98 98
      * @param $stringJoin
99 99
      * @return $this
100 100
      */
101
-    public function join($stringJoin)
101
+    public function join( $stringJoin )
102 102
     {
103
-        $this->queryStructure->setElement(QueryStructure::JOIN, $stringJoin);
103
+        $this->queryStructure->setElement( QueryStructure::JOIN, $stringJoin );
104 104
 
105 105
         return $this;
106 106
     }
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
      * @param null $onRight
113 113
      * @return $this
114 114
      */
115
-    private function makeJoin($typeJoin, $tableJoin, $onLeft, $onRight = null)
115
+    private function makeJoin( $typeJoin, $tableJoin, $onLeft, $onRight = null )
116 116
     {
117 117
         $join = $typeJoin . ' ' . $tableJoin;
118 118
 
119
-        if (is_null($onRight))
119
+        if ( is_null( $onRight ) )
120 120
             $join .= " USING ( $onLeft )"; else
121 121
             $join .= " ON $onLeft = $onRight";
122 122
 
123
-        $this->queryStructure->setElement(QueryStructure::JOIN, $join);
123
+        $this->queryStructure->setElement( QueryStructure::JOIN, $join );
124 124
 
125 125
         return $this;
126 126
     }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
      */
131 131
     private function getJoinSyntax()
132 132
     {
133
-        $joinString = implode(' ', $this->queryStructure->getElement(QueryStructure::JOIN));
133
+        $joinString = implode( ' ', $this->queryStructure->getElement( QueryStructure::JOIN ) );
134 134
 
135
-        return QueryHelper::clearMultipleSpaces($joinString);
135
+        return QueryHelper::clearMultipleSpaces( $joinString );
136 136
     }
137 137
 
138 138
 }
139 139
\ No newline at end of file
Please login to merge, or discard this patch.
src/Traits/TableValidation.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
 trait TableValidation
19 19
 {
20 20
 
21
-    private function validateTable($table)
21
+    private function validateTable( $table )
22 22
     {
23
-        switch (gettype($table)) {
23
+        switch ( gettype( $table ) ) {
24 24
 
25 25
             case QueryStructure::ELEMENT_TYPE_STRING:
26
-                $table = $this->validateTableName($table);
26
+                $table = $this->validateTableName( $table );
27 27
                 break;
28 28
             case QueryStructure::ELEMENT_TYPE_OBJECT:
29
-                $table = $this->validateTableSubQuery($table);
29
+                $table = $this->validateTableSubQuery( $table );
30 30
                 break;
31 31
             default:
32
-                throw new QueryException('Invalid table type parameter: ' . gettype($table), QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT);
32
+                throw new QueryException( 'Invalid table type parameter: ' . gettype( $table ), QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT );
33 33
 
34 34
         }
35 35
 
@@ -41,26 +41,26 @@  discard block
 block discarded – undo
41 41
      * @return mixed|string
42 42
      * @throws QueryException
43 43
      */
44
-    private function validateTableName($table)
44
+    private function validateTableName( $table )
45 45
     {
46
-        $table = trim($table);
46
+        $table = trim( $table );
47 47
 
48
-        if ('' === $table)
49
-            throw new QueryException('Table name is empty string!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT);
48
+        if ( '' === $table )
49
+            throw new QueryException( 'Table name is empty string!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT );
50 50
 
51
-        if (DbConfig::getInstance()->useTablePrefix())
52
-            $table = str_ireplace('::', DbConfig::getInstance()->getTablePrefix(), $table);
51
+        if ( DbConfig::getInstance()->useTablePrefix() )
52
+            $table = str_ireplace( '::', DbConfig::getInstance()->getTablePrefix(), $table );
53 53
 
54 54
         return $table;
55 55
     }
56 56
 
57
-    private function validateTableSubQuery($table)
57
+    private function validateTableSubQuery( $table )
58 58
     {
59
-        if ($this->statement !== QueryStatement::QUERY_STATEMENT_SELECT)
60
-            throw new QueryException('Invalid subQuery statement!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT);
59
+        if ( $this->statement !== QueryStatement::QUERY_STATEMENT_SELECT )
60
+            throw new QueryException( 'Invalid subQuery statement!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT );
61 61
 
62
-        if (!is_a($table, QuerySelect::class))
63
-            throw new QueryException('Invalid subQuery statement!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT);
62
+        if ( !is_a( $table, QuerySelect::class ) )
63
+            throw new QueryException( 'Invalid subQuery statement!', QueryException::QUERY_ERROR_INVALID_TABLE_STATEMENT );
64 64
 
65 65
         return $table;
66 66
     }
Please login to merge, or discard this patch.
src/Traits/Where.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
      * @param $glue
23 23
      * @return $this
24 24
      */
25
-    public function whereEqual($field, $value, $glue = 'AND')
25
+    public function whereEqual( $field, $value, $glue = 'AND' )
26 26
     {
27
-        return $this->where(array($field, $value, '='), $glue);
27
+        return $this->where( array( $field, $value, '=' ), $glue );
28 28
     }
29 29
 
30 30
     /**
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
      * @param $value
33 33
      * @return $this
34 34
      */
35
-    public function orWhereEqual($field, $value)
35
+    public function orWhereEqual( $field, $value )
36 36
     {
37
-        return $this->where(array($field, $value, '='), 'OR');
37
+        return $this->where( array( $field, $value, '=' ), 'OR' );
38 38
     }
39 39
 
40 40
     /**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
      * @param string $glue
44 44
      * @return $this
45 45
      */
46
-    public function whereNotEqual($field, $value, $glue = 'AND')
46
+    public function whereNotEqual( $field, $value, $glue = 'AND' )
47 47
     {
48
-        return $this->where(array($field, $value, '<>'), $glue);
48
+        return $this->where( array( $field, $value, '<>' ), $glue );
49 49
     }
50 50
 
51 51
     /**
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
      * @param $value
54 54
      * @return $this
55 55
      */
56
-    public function orWhereNotEqual($field, $value)
56
+    public function orWhereNotEqual( $field, $value )
57 57
     {
58
-        return $this->where(array($field, $value, '<>'), 'OR');
58
+        return $this->where( array( $field, $value, '<>' ), 'OR' );
59 59
     }
60 60
 
61 61
     /**
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
      * @param string $glue
65 65
      * @return $this
66 66
      */
67
-    public function whereLessThan($field, $value, $glue = 'AND')
67
+    public function whereLessThan( $field, $value, $glue = 'AND' )
68 68
     {
69
-        return $this->where(array($field, $value, '<'), $glue);
69
+        return $this->where( array( $field, $value, '<' ), $glue );
70 70
     }
71 71
 
72 72
     /**
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
      * @param $value
75 75
      * @return $this
76 76
      */
77
-    public function orWhereLessThan($field, $value)
77
+    public function orWhereLessThan( $field, $value )
78 78
     {
79
-        return $this->where(array($field, $value, '<'), 'OR');
79
+        return $this->where( array( $field, $value, '<' ), 'OR' );
80 80
     }
81 81
 
82 82
     /**
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
      * @param string $glue
86 86
      * @return $this
87 87
      */
88
-    public function whereLessThanOrEqual($field, $value, $glue = 'AND')
88
+    public function whereLessThanOrEqual( $field, $value, $glue = 'AND' )
89 89
     {
90
-        return $this->where(array($field, $value, '<='), $glue);
90
+        return $this->where( array( $field, $value, '<=' ), $glue );
91 91
     }
92 92
 
93 93
     /**
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
      * @param $value
96 96
      * @return $this
97 97
      */
98
-    public function orWhereLessThanOrEqual($field, $value)
98
+    public function orWhereLessThanOrEqual( $field, $value )
99 99
     {
100
-        return $this->where(array($field, $value, '<='), 'OR');
100
+        return $this->where( array( $field, $value, '<=' ), 'OR' );
101 101
     }
102 102
 
103 103
     /**
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
      * @param string $glue
107 107
      * @return $this
108 108
      */
109
-    public function whereGreaterThan($field, $value, $glue = 'AND')
109
+    public function whereGreaterThan( $field, $value, $glue = 'AND' )
110 110
     {
111
-        return $this->where(array($field, $value, '>'), $glue);
111
+        return $this->where( array( $field, $value, '>' ), $glue );
112 112
     }
113 113
 
114 114
     /**
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
      * @param $value
117 117
      * @return $this
118 118
      */
119
-    public function orWhereGreaterThan($field, $value)
119
+    public function orWhereGreaterThan( $field, $value )
120 120
     {
121
-        return $this->where(array($field, $value, '>'), 'OR');
121
+        return $this->where( array( $field, $value, '>' ), 'OR' );
122 122
     }
123 123
 
124 124
     /**
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
      * @param string $glue
128 128
      * @return $this
129 129
      */
130
-    public function whereGreaterThanOrEqual($field, $value, $glue = 'AND')
130
+    public function whereGreaterThanOrEqual( $field, $value, $glue = 'AND' )
131 131
     {
132
-        return $this->where(array($field, $value, '>='), $glue);
132
+        return $this->where( array( $field, $value, '>=' ), $glue );
133 133
     }
134 134
 
135 135
     /**
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
      * @param $value
138 138
      * @return $this
139 139
      */
140
-    public function orWhereGreaterThanOrEqual($field, $value)
140
+    public function orWhereGreaterThanOrEqual( $field, $value )
141 141
     {
142
-        return $this->where(array($field, $value, '>='), 'OR');
142
+        return $this->where( array( $field, $value, '>=' ), 'OR' );
143 143
     }
144 144
 
145 145
     /**
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
      * @param string $glue
149 149
      * @return $this
150 150
      */
151
-    public function whereLike($field, $value, $glue = 'AND')
151
+    public function whereLike( $field, $value, $glue = 'AND' )
152 152
     {
153
-        return $this->where(array($field, $value, 'LIKE'), $glue);
153
+        return $this->where( array( $field, $value, 'LIKE' ), $glue );
154 154
     }
155 155
 
156 156
     /**
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
      * @param $value
159 159
      * @return $this
160 160
      */
161
-    public function orWhereLike($field, $value)
161
+    public function orWhereLike( $field, $value )
162 162
     {
163
-        return $this->where(array($field, $value, 'LIKE'), 'OR');
163
+        return $this->where( array( $field, $value, 'LIKE' ), 'OR' );
164 164
     }
165 165
 
166 166
     /**
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
      * @param string $glue
170 170
      * @return $this
171 171
      */
172
-    public function whereNotLike($field, $value, $glue = 'AND')
172
+    public function whereNotLike( $field, $value, $glue = 'AND' )
173 173
     {
174
-        return $this->where(array($field, $value, 'NOT LIKE'), $glue);
174
+        return $this->where( array( $field, $value, 'NOT LIKE' ), $glue );
175 175
     }
176 176
 
177 177
     /**
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
      * @param $value
180 180
      * @return $this
181 181
      */
182
-    public function orWhereNotLike($field, $value)
182
+    public function orWhereNotLike( $field, $value )
183 183
     {
184
-        return $this->where(array($field, $value, 'NOT LIKE'), 'OR');
184
+        return $this->where( array( $field, $value, 'NOT LIKE' ), 'OR' );
185 185
     }
186 186
 
187 187
     /**
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
      * @param string $glue
192 192
      * @return $this
193 193
      */
194
-    public function whereBetween($field, $min, $max, $glue = 'AND')
194
+    public function whereBetween( $field, $min, $max, $glue = 'AND' )
195 195
     {
196
-        return $this->where(array($field, array($min, $max), 'BETWEEN'), $glue);
196
+        return $this->where( array( $field, array( $min, $max ), 'BETWEEN' ), $glue );
197 197
     }
198 198
 
199 199
     /**
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
      * @param $max
203 203
      * @return $this
204 204
      */
205
-    public function orWhereBetween($field, $min, $max)
205
+    public function orWhereBetween( $field, $min, $max )
206 206
     {
207
-        return $this->where(array($field, array($min, $max), 'BETWEEN'), 'OR');
207
+        return $this->where( array( $field, array( $min, $max ), 'BETWEEN' ), 'OR' );
208 208
     }
209 209
 
210 210
     /**
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
      * @param string $glue
215 215
      * @return $this
216 216
      */
217
-    public function whereNotBetween($field, $min, $max, $glue = 'AND')
217
+    public function whereNotBetween( $field, $min, $max, $glue = 'AND' )
218 218
     {
219
-        return $this->where(array($field, array($min, $max), 'NOT BETWEEN'), $glue);
219
+        return $this->where( array( $field, array( $min, $max ), 'NOT BETWEEN' ), $glue );
220 220
     }
221 221
 
222 222
     /**
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
      * @param $max
226 226
      * @return $this
227 227
      */
228
-    public function orWhereNotBetween($field, $min, $max)
228
+    public function orWhereNotBetween( $field, $min, $max )
229 229
     {
230
-        return $this->where(array($field, array($min, $max), 'NOT BETWEEN'), 'OR');
230
+        return $this->where( array( $field, array( $min, $max ), 'NOT BETWEEN' ), 'OR' );
231 231
     }
232 232
 
233 233
     /**
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
      * @param string $glue
237 237
      * @return $this
238 238
      */
239
-    public function whereIn($field, $value, $glue = 'AND')
239
+    public function whereIn( $field, $value, $glue = 'AND' )
240 240
     {
241
-        return $this->where(array($field, $value, 'IN'), $glue);
241
+        return $this->where( array( $field, $value, 'IN' ), $glue );
242 242
     }
243 243
 
244 244
     /**
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
      * @param $value
247 247
      * @return $this
248 248
      */
249
-    public function orWhereIn($field, $value)
249
+    public function orWhereIn( $field, $value )
250 250
     {
251
-        return $this->where(array($field, $value, 'IN'), 'OR');
251
+        return $this->where( array( $field, $value, 'IN' ), 'OR' );
252 252
     }
253 253
 
254 254
     /**
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
      * @param string $glue
258 258
      * @return $this
259 259
      */
260
-    public function whereNotIn($field, $value, $glue = 'AND')
260
+    public function whereNotIn( $field, $value, $glue = 'AND' )
261 261
     {
262
-        return $this->where(array($field, $value, 'NOT IN'), $glue);
262
+        return $this->where( array( $field, $value, 'NOT IN' ), $glue );
263 263
     }
264 264
 
265 265
     /**
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
      * @param $value
268 268
      * @return $this
269 269
      */
270
-    public function orWhereNotIn($field, $value)
270
+    public function orWhereNotIn( $field, $value )
271 271
     {
272
-        return $this->where(array($field, $value, 'NOT IN'), 'OR');
272
+        return $this->where( array( $field, $value, 'NOT IN' ), 'OR' );
273 273
     }
274 274
 
275 275
     /**
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
      * @param string $glue
279 279
      * @return $this
280 280
      */
281
-    public function whereExpression($whereString, array $bindParams = [], $glue = 'AND')
281
+    public function whereExpression( $whereString, array $bindParams = [ ], $glue = 'AND' )
282 282
     {
283
-        $whereString = $this->queryStructure->bindParamsExpression($whereString, $bindParams);
283
+        $whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
284 284
 
285
-        return $this->where($whereString, $glue);
285
+        return $this->where( $whereString, $glue );
286 286
     }
287 287
 
288 288
     /**
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
      * @param array $bindParams
291 291
      * @return $this
292 292
      */
293
-    public function orWhereExpression($whereString, array $bindParams = [])
293
+    public function orWhereExpression( $whereString, array $bindParams = [ ] )
294 294
     {
295
-        $whereString = $this->queryStructure->bindParamsExpression($whereString, $bindParams);
295
+        $whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
296 296
 
297
-        return $this->where($whereString, 'OR');
297
+        return $this->where( $whereString, 'OR' );
298 298
     }
299 299
 
300 300
     /**
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function whereInvertResult()
304 304
     {
305
-        $this->queryStructure->setElement(QueryStructure::WHERE_INVERT, 1);
305
+        $this->queryStructure->setElement( QueryStructure::WHERE_INVERT, 1 );
306 306
 
307 307
         return $this;
308 308
     }
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
      * @param string $glue
312 312
      * @return $this
313 313
      */
314
-    public function whereGroup($glue = 'AND')
314
+    public function whereGroup( $glue = 'AND' )
315 315
     {
316
-        $this->queryStructure->setElement(QueryStructure::WHERE, array('glue' => $glue, 'body' => '(', 'type' => 'start_where_group'));
316
+        $this->queryStructure->setElement( QueryStructure::WHERE, array( 'glue' => $glue, 'body' => '(', 'type' => 'start_where_group' ) );
317 317
 
318 318
         return $this;
319 319
     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public function orWhereGroup()
325 325
     {
326
-        return $this->whereGroup('OR');
326
+        return $this->whereGroup( 'OR' );
327 327
     }
328 328
 
329 329
     /**
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
      */
332 332
     public function whereGroupEnd()
333 333
     {
334
-        $this->queryStructure->setElement(QueryStructure::WHERE, array('glue' => '', 'body' => ')', 'type' => 'end_where_group'));
334
+        $this->queryStructure->setElement( QueryStructure::WHERE, array( 'glue' => '', 'body' => ')', 'type' => 'end_where_group' ) );
335 335
 
336 336
         return $this;
337 337
     }
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      */
342 342
     public function ignoreWhereTrigger()
343 343
     {
344
-        $this->queryStructure->setElement(QueryStructure::WHERE_TRIGGER, 0);
344
+        $this->queryStructure->setElement( QueryStructure::WHERE_TRIGGER, 0 );
345 345
 
346 346
         return $this;
347 347
     }
@@ -352,10 +352,10 @@  discard block
 block discarded – undo
352 352
      * @param string $glue
353 353
      * @return $this
354 354
      */
355
-    private function where($param, $glue = 'AND')
355
+    private function where( $param, $glue = 'AND' )
356 356
     {
357 357
         return $this->/** @scrutinizer ignore-call */
358
-        createCondition($param, $glue, QueryStructure::WHERE);
358
+        createCondition( $param, $glue, QueryStructure::WHERE );
359 359
     }
360 360
 
361 361
 }
362 362
\ No newline at end of file
Please login to merge, or discard this patch.
src/Traits/Limit.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,38 +24,38 @@
 block discarded – undo
24 24
      * @return $this
25 25
      * @throws QueryException
26 26
      */
27
-    public function limit($limit = 0, $offset = null)
27
+    public function limit( $limit = 0, $offset = null )
28 28
     {
29
-        $limit = trim($limit);
29
+        $limit = trim( $limit );
30 30
 
31
-        if (!QueryHelper::isInteger($limit))
32
-            throw new QueryException('Invalid Limit value', QueryException::QUERY_ERROR_INVALID_LIMIT);
31
+        if ( !QueryHelper::isInteger( $limit ) )
32
+            throw new QueryException( 'Invalid Limit value', QueryException::QUERY_ERROR_INVALID_LIMIT );
33 33
 
34
-        if ($limit == 0)
35
-            throw new QueryException('Invalid Limit zero', QueryException::QUERY_ERROR_INVALID_LIMIT_ZERO);
34
+        if ( $limit == 0 )
35
+            throw new QueryException( 'Invalid Limit zero', QueryException::QUERY_ERROR_INVALID_LIMIT_ZERO );
36 36
 
37
-        if (is_null($offset)) {
38
-            $this->queryStructure->setElement(QueryStructure::LIMIT, $limit);
37
+        if ( is_null( $offset ) ) {
38
+            $this->queryStructure->setElement( QueryStructure::LIMIT, $limit );
39 39
 
40 40
             return $this;
41 41
         }
42 42
 
43
-        $offset = trim($offset);
43
+        $offset = trim( $offset );
44 44
 
45
-        if (!QueryHelper::isInteger($offset))
46
-            throw new QueryException('Invalid Limit offset', QueryException::QUERY_ERROR_INVALID_LIMIT_OFFSET);
45
+        if ( !QueryHelper::isInteger( $offset ) )
46
+            throw new QueryException( 'Invalid Limit offset', QueryException::QUERY_ERROR_INVALID_LIMIT_OFFSET );
47 47
 
48
-        $this->queryStructure->setElement(QueryStructure::LIMIT, $offset . ',' . $limit);
48
+        $this->queryStructure->setElement( QueryStructure::LIMIT, $offset . ',' . $limit );
49 49
 
50 50
         return $this;
51 51
     }
52 52
 
53 53
     private function getLimitSyntax()
54 54
     {
55
-        if (!$this->queryStructure->getElement(QueryStructure::LIMIT))
55
+        if ( !$this->queryStructure->getElement( QueryStructure::LIMIT ) )
56 56
             return '';
57 57
 
58
-        return 'LIMIT ' . $this->queryStructure->getElement(QueryStructure::LIMIT);
58
+        return 'LIMIT ' . $this->queryStructure->getElement( QueryStructure::LIMIT );
59 59
     }
60 60
 
61 61
 }
Please login to merge, or discard this patch.
src/Traits/ColumnValidation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
 
15 15
     use Objects;
16 16
 
17
-    protected function validateColumn($columnName, array $allowed)
17
+    protected function validateColumn( $columnName, array $allowed )
18 18
     {
19
-        if (is_integer($columnName))
19
+        if ( is_integer( $columnName ) )
20 20
             return true;
21 21
 
22
-        if (!count($allowed))
22
+        if ( !count( $allowed ) )
23 23
             return true;
24 24
 
25 25
         return false;
Please login to merge, or discard this patch.
src/Traits/Utilities.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function explain()
23 23
     {
24
-        $this->queryStructure->setElement(QueryStructure::EXPLAIN, 1);
24
+        $this->queryStructure->setElement( QueryStructure::EXPLAIN, 1 );
25 25
 
26 26
         return $this;
27 27
     }
28 28
 
29 29
     protected function getExplainSyntax()
30 30
     {
31
-        if ($this->queryStructure->getElement(QueryStructure::EXPLAIN))
31
+        if ( $this->queryStructure->getElement( QueryStructure::EXPLAIN ) )
32 32
             return 'EXPLAIN';
33 33
 
34 34
         return '';
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
      * @param string $comment
40 40
      * @return $this
41 41
      */
42
-    public function withComment($comment = '')
42
+    public function withComment( $comment = '' )
43 43
     {
44
-        $this->queryStructure->setElement(QueryStructure::QUERY_COMMENT, $comment);
44
+        $this->queryStructure->setElement( QueryStructure::QUERY_COMMENT, $comment );
45 45
 
46 46
         return $this;
47 47
     }
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
      * @param string $identifier
51 51
      * @return $this
52 52
      */
53
-    public function withLogIdentifier($identifier = null)
53
+    public function withLogIdentifier( $identifier = null )
54 54
     {
55
-        $this->queryStructure->setElement(QueryStructure::QUERY_IDENTIFIER, $identifier);
55
+        $this->queryStructure->setElement( QueryStructure::QUERY_IDENTIFIER, $identifier );
56 56
 
57 57
         return $this;
58 58
     }
Please login to merge, or discard this patch.
src/Traits/Ignore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function ignore()
23 23
     {
24
-        $this->queryStructure->setElement(QueryStructure::IGNORE, 1);
24
+        $this->queryStructure->setElement( QueryStructure::IGNORE, 1 );
25 25
 
26 26
         return $this;
27 27
     }
Please login to merge, or discard this patch.