@@ -9,9 +9,9 @@ discard block |
||
| 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 |
||
| 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); |
@@ -56,13 +56,13 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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( |