Completed
Pull Request — master (#10)
by Edgard
15:15
created
src/QueryBuilder.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -75,6 +75,9 @@  discard block
 block discarded – undo
75 75
         return $request;
76 76
     }
77 77
 
78
+    /**
79
+     * @param string $action
80
+     */
78 81
     public function buildMethod(Request $request, $action, $params = [])
79 82
     {
80 83
         static $defaultMethods = [
@@ -109,6 +112,9 @@  discard block
 block discarded – undo
109 112
         return $request;
110 113
     }
111 114
 
115
+    /**
116
+     * @param string $count
117
+     */
112 118
     public function buildCount(Request $request, $count, $params = [])
113 119
     {
114 120
         if ($count) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function buildCount(Request $request, $count, $params = [])
113 113
     {
114 114
         if ($count) {
115
-            $request->on(Request::EVENT_AFTER_SEND, function (\yii\httpclient\RequestEvent $event) {
115
+            $request->on(Request::EVENT_AFTER_SEND, function(\yii\httpclient\RequestEvent $event) {
116 116
                 $data = $event->response->getData();
117 117
                 $event->response->setData(count($data));
118 118
             });
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
                 return $this->$method($operator, $condition);
240 240
             } else {
241
-                throw new InvalidParamException('Found unknown operator in query: ' . $operator);
241
+                throw new InvalidParamException('Found unknown operator in query: '.$operator);
242 242
             }
243 243
         } else {
244 244
             return $this->buildHashCondition($condition);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         foreach ($condition as $attribute => $value) {
252 252
             if (is_array($value)) { // IN condition
253 253
                 // $parts[] = [$attribute.'s' => join(',',$value)];
254
-                $parts[$attribute . 's'] = implode(',', $value);
254
+                $parts[$attribute.'s'] = implode(',', $value);
255 255
             } else {
256 256
                 $parts[$attribute] = $value;
257 257
             }
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
 
263 263
     protected function buildLikeCondition($operator, $operands)
264 264
     {
265
-        return [$operands[0] . '_like' => $operands[1]];
265
+        return [$operands[0].'_like' => $operands[1]];
266 266
     }
267 267
 
268 268
     protected function buildIlikeCondition($operator, $operands)
269 269
     {
270
-        return [$operands[0] . '_ilike' => $operands[1]];
270
+        return [$operands[0].'_ilike' => $operands[1]];
271 271
     }
272 272
 
273 273
     protected function buildCompareCondition($operator, $operands)
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             throw new InvalidParamException("Operator '$operator' requires three operands.");
277 277
         }
278 278
 
279
-        return [$operands[0] . '_' . $operator => $operands[1]];
279
+        return [$operands[0].'_'.$operator => $operands[1]];
280 280
     }
281 281
 
282 282
     protected function buildAndCondition($operator, $operands)
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
         }
324 324
 
325 325
         if ($not) {
326
-            $key = $column . '_ni'; // not in
326
+            $key = $column.'_ni'; // not in
327 327
         } else {
328
-            $key = $column . '_in';
328
+            $key = $column.'_in';
329 329
         }
330 330
         return [$key => $values];
331 331
     }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
     {
347 347
         $key = array_shift($operands);
348 348
 
349
-        return [$key . '_' . $operator => reset($operands)];
349
+        return [$key.'_'.$operator => reset($operands)];
350 350
     }
351 351
 
352 352
     protected function buildCompositeInCondition($operator, $columns, $values)
Please login to merge, or discard this patch.