Completed
Push — master ( bfa2f5...7c93fc )
by hook
02:24
created
src/Grammars/DynamoDBGrammar.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
         'begins_with'
15 15
     ];
16 16
 
17
-    protected $params = [];
17
+    protected $params = [ ];
18 18
 
19
-    protected $insertParam = [];
19
+    protected $insertParam = [ ];
20 20
 
21 21
     /**
22 22
      * @var Builder
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     private $dynamoDBBuilder;
31 31
 
32
-    private $attributeValues = [];
32
+    private $attributeValues = [ ];
33 33
 
34 34
     /** @var Marshaler $marshaler */
35 35
     private $marshaler;
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
     // 表达式解析 where
53 53
     private function parseKeyConditionExpression()
54 54
     {
55
-        $expression = [];
55
+        $expression = [ ];
56 56
 
57 57
         foreach ($this->builder->wheres as $index => $where) {
58
-            switch (strtolower($where['operator'])){
58
+            switch (strtolower($where[ 'operator' ])) {
59 59
                 case "begins_with":
60
-                    $expression[] = "begins_with({$where['column']}, :{$index})";
60
+                    $expression[ ] = "begins_with({$where[ 'column' ]}, :{$index})";
61 61
                     break;
62 62
                 default:
63
-                    $expression[] = "{$where['column']} {$where['operator']} :{$index}";
63
+                    $expression[ ] = "{$where[ 'column' ]} {$where[ 'operator' ]} :{$index}";
64 64
             }
65 65
 
66 66
             // param bind
67
-            $this->attributeValues[':' . $index] = $where['value'];
67
+            $this->attributeValues[ ':'.$index ] = $where[ 'value' ];
68 68
         }
69 69
         return implode(" and ", $expression);
70 70
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $this->createInsertParam($data);
105 105
 
106 106
         $builder = $this->dynamoDBBuilder
107
-            ->setRequestItems([$this->builder->table => $this->insertParam]);
107
+            ->setRequestItems([ $this->builder->table => $this->insertParam ]);
108 108
 
109 109
         return $builder->batchWriteItem();
110 110
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             if (is_numeric($key) && is_array($value)) {
116 116
                 $this->createInsertParam($value);
117 117
             } else {
118
-                $this->insertParam[] = [
118
+                $this->insertParam[ ] = [
119 119
                     'PutRequest' => [
120 120
                         'Item' => $this->marshaler->marshalItem($data)
121 121
                     ]
Please login to merge, or discard this patch.