Completed
Push — master ( d4a92d...b23853 )
by hook
05:07 queued 02:55
created
work2.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 
10
-class Table{
10
+class Table {
11 11
     public function getuser()
12 12
     {
13 13
         return "ok";
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
         echo "class find\r\n";
21 21
 
22 22
         $t1 = microtime(true);
23
-        foreach (range(1,500) as $a){
23
+        foreach (range(1, 500) as $a) {
24 24
             $func = "get".$field;
25
-            if (method_exists($this,$func)) {
26
-                call_user_func([$this,$func]);
25
+            if (method_exists($this, $func)) {
26
+                call_user_func([ $this, $func ]);
27 27
             }
28 28
         }
29 29
 
30
-        var_dump(microtime(true)-$t1);
30
+        var_dump(microtime(true) - $t1);
31 31
 
32 32
 
33 33
 
34 34
         echo "array find\r\n";
35 35
         $t1 = microtime(true);
36
-        foreach (range(1,500) as $a) {
37
-            $a = ['set.user' => 'getuser', 'get.user' => 'getuser'];
38
-            $func = 'set.' . $field;
36
+        foreach (range(1, 500) as $a) {
37
+            $a = [ 'set.user' => 'getuser', 'get.user' => 'getuser' ];
38
+            $func = 'set.'.$field;
39 39
 //            if (isset($a[$func])) {
40
-                call_user_func([$this, $a[$func]]);
40
+                call_user_func([ $this, $a[ $func ] ]);
41 41
 //            }
42 42
         }
43
-        var_dump(microtime(true)-$t1);
43
+        var_dump(microtime(true) - $t1);
44 44
     }
45 45
 }
46 46
 
Please login to merge, or discard this patch.
src/DB.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 namespace Hoooklife\DynamodbPodm;
3 3
 use Hoooklife\DynamodbPodm\Query\Builder;
4 4
 class DB {
5
-    public static $config = [];
5
+    public static $config = [ ];
6 6
 
7 7
     public static function config(array $config)
8 8
     {
Please login to merge, or discard this patch.
test-sdk.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 
29 29
 $item = $marshaler->marshalJson('
30 30
     {
31
-        "year": ' . $year . ',
32
-        "title": "' . $title . '",
31
+        "year": ' . $year.',
32
+        "title": "' . $title.'",
33 33
         "info": {
34 34
             "plot": "Nothing happens at all.",
35 35
             "rating": 0
@@ -52,5 +52,5 @@  discard block
 block discarded – undo
52 52
 
53 53
 } catch (DynamoDbException $e) {
54 54
     echo "Unable to add item:\n";
55
-    echo $e->getMessage() . "\n";
55
+    echo $e->getMessage()."\n";
56 56
 }
57 57
\ No newline at end of file
Please login to merge, or discard this patch.
src/Query/Builder.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function __construct($connection = 'default')
30 30
     {
31
-        switch (DB::$config[$connection]['driver']) {
31
+        switch (DB::$config[ $connection ][ 'driver' ]) {
32 32
             case "dynamedb":
33
-                $this->grammar = new DynamoDBGrammar($this, DB::$config[$connection]);
33
+                $this->grammar = new DynamoDBGrammar($this, DB::$config[ $connection ]);
34 34
                 break;
35 35
             default:
36 36
                 throw new Exception("bad driver");
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param  array|mixed $columns
45 45
      * @return $this
46 46
      */
47
-    public function select($columns = ['*'])
47
+    public function select($columns = [ '*' ])
48 48
     {
49 49
         $this->columns = is_array($columns) ? $columns : func_get_args();
50 50
         return $this;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function addSelect($columns)
61 61
     {
62 62
         $columns = is_array($columns) ? $columns : func_get_args();
63
-        $this->columns = array_merge((array)$this->columns, $columns);
63
+        $this->columns = array_merge((array) $this->columns, $columns);
64 64
         return $this;
65 65
     }
66 66
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         }
105 105
 
106 106
         if (func_num_args() === 2 || $this->invalidOperator($operator)) {
107
-            list($value, $operator) = [$operator, '='];
107
+            list($value, $operator) = [ $operator, '=' ];
108 108
         }
109 109
 
110 110
         // where in
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 
121 121
         $type = 'Basic';
122
-        $this->wheres[] = compact(
122
+        $this->wheres[ ] = compact(
123 123
             'type', 'column', 'operator', 'value', 'boolean'
124 124
         );
125 125
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      */
236 236
     public function value($column)
237 237
     {
238
-        $result = (array)$this->first([$column]);
238
+        $result = (array) $this->first([ $column ]);
239 239
         return count($result) > 0 ? reset($result) : null;
240 240
     }
241 241
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      * @param  array $columns
247 247
      * @return \Illuminate\Database\Eloquent\Model|object|static|null
248 248
      */
249
-    public function first($columns = ['*'])
249
+    public function first($columns = [ '*' ])
250 250
     {
251 251
         return reset($this->take(1)->all($columns));
252 252
     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      * @param  array $columns
259 259
      * @return void
260 260
      */
261
-    public function all($columns = ['*'])
261
+    public function all($columns = [ '*' ])
262 262
     {
263 263
         return $this->grammar->all();
264 264
     }
Please login to merge, or discard this patch.
src/Grammars/DynamoDBGrammar.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 class DynamoDBGrammar
11 11
 {
12
-    protected $operators = [];
12
+    protected $operators = [ ];
13 13
 
14
-    protected $params = [];
14
+    protected $params = [ ];
15 15
 
16 16
     /**
17 17
      * @var Builder
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
     // 表达式解析 where
41 41
     public function parseKeyConditionExpression()
42 42
     {
43
-        $expression = [];
43
+        $expression = [ ];
44 44
         foreach ($this->builder->wheres as $where) {
45
-            $expression[] = "{$where['column']} {$where['operator']} {$where['value']}";
45
+            $expression[ ] = "{$where[ 'column' ]} {$where[ 'operator' ]} {$where[ 'value' ]}";
46 46
         }
47 47
 
48 48
         return implode("and", $expression);
Please login to merge, or discard this patch.
src/Grammars/DynamoDBBuilder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
      *
57 57
      * @var array
58 58
      */
59
-    public $query = [];
59
+    public $query = [ ];
60 60
 
61 61
     protected $dynamodbClient;
62 62
 
63 63
     public function __construct(array $config)
64 64
     {
65
-        $this->dynamodbClient = new DynamoDbClient($config["S3Config"]);
65
+        $this->dynamodbClient = new DynamoDbClient($config[ "S3Config" ]);
66 66
     }
67 67
 
68 68
     public function hydrate(array $query)
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
     }
73 73
     public function setExpressionAttributeName($placeholder, $name)
74 74
     {
75
-        $this->query['ExpressionAttributeNames'][$placeholder] = $name;
75
+        $this->query[ 'ExpressionAttributeNames' ][ $placeholder ] = $name;
76 76
         return $this;
77 77
     }
78 78
     public function setExpressionAttributeValue($placeholder, $value)
79 79
     {
80
-        $this->query['ExpressionAttributeValues'][$placeholder] = $value;
80
+        $this->query[ 'ExpressionAttributeValues' ][ $placeholder ] = $value;
81 81
         return $this;
82 82
     }
83 83
 
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
     public function __call($method, $parameters)
101 101
     {
102 102
         if (strpos($method, 'set') === 0) {
103
-            $key = array_reverse(explode('set', $method, 2))[0];
104
-            $this->query[$key] = current($parameters);
103
+            $key = array_reverse(explode('set', $method, 2))[ 0 ];
104
+            $this->query[ $key ] = current($parameters);
105 105
             return $this;
106 106
         }
107 107
         throw new BadMethodCallException(sprintf(
Please login to merge, or discard this patch.