ExecutableQuery   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 26
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __call() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Hoooklife\DynamodbPodm\DynamoDB;
4
5
use Aws\DynamoDb\DynamoDbClient;
6
7
/**
8
 * Class ExecutableQuery
9
 *
10
 * @package BaoPham\DynamoDb\DynamoDb
11
 *
12
 * @method \Aws\Result batchGetItem()
13
 * @method \GuzzleHttp\Promise\Promise batchGetItemAsync()
14
 * @method \Aws\Result batchWriteItem()
15
 * @method \GuzzleHttp\Promise\Promise batchWriteItemAsync()
16
 * @method \Aws\Result createTable()
17
 * @method \GuzzleHttp\Promise\Promise createTableAsync()
18
 * @method \Aws\Result deleteItem()
19
 * @method \GuzzleHttp\Promise\Promise deleteItemAsync()
20
 * @method \Aws\Result deleteTable()
21
 * @method \GuzzleHttp\Promise\Promise deleteTableAsync()
22
 * @method \Aws\Result describeTable()
23
 * @method \GuzzleHttp\Promise\Promise describeTableAsync()
24
 * @method \GuzzleHttp\Promise\Promise getItemAsync()
25
 * @method \Aws\Result listTables()
26
 * @method \GuzzleHttp\Promise\Promise listTablesAsync()
27
 * @method \Aws\Result putItem()
28
 * @method \GuzzleHttp\Promise\Promise putItemAsync()
29
 * @method \Aws\Result scan()
30
 * @method \GuzzleHttp\Promise\Promise scanAsync()
31
 * @method \Aws\Result updateItem()
32
 * @method \GuzzleHttp\Promise\Promise updateItemAsync()
33
 * @method \Aws\Result updateTable()
34
 * @method \GuzzleHttp\Promise\Promise updateTableAsync()
35
 * @method \Aws\Result createBackup() (supported in versions 2012-08-10)
36
 * @method \GuzzleHttp\Promise\Promise createBackupAsync() (supported in versions 2012-08-10)
37
 * @method \Aws\Result createGlobalTable() (supported in versions 2012-08-10)
38
 * @method \GuzzleHttp\Promise\Promise createGlobalTableAsync() (supported in versions 2012-08-10)
39
 * @method \Aws\Result deleteBackup() (supported in versions 2012-08-10)
40
 * @method \GuzzleHttp\Promise\Promise deleteBackupAsync() (supported in versions 2012-08-10)
41
 * @method \Aws\Result describeBackup() (supported in versions 2012-08-10)
42
 * @method \GuzzleHttp\Promise\Promise describeBackupAsync() (supported in versions 2012-08-10)
43
 * @method \Aws\Result describeContinuousBackups() (supported in versions 2012-08-10)
44
 * @method \GuzzleHttp\Promise\Promise describeContinuousBackupsAsync() (supported in versions 2012-08-10)
45
 * @method \Aws\Result describeGlobalTable() (supported in versions 2012-08-10)
46
 * @method \GuzzleHttp\Promise\Promise describeGlobalTableAsync() (supported in versions 2012-08-10)
47
 * @method \Aws\Result describeLimits() (supported in versions 2012-08-10)
48
 * @method \GuzzleHttp\Promise\Promise describeLimitsAsync() (supported in versions 2012-08-10)
49
 * @method \Aws\Result describeTimeToLive() (supported in versions 2012-08-10)
50
 * @method \GuzzleHttp\Promise\Promise describeTimeToLiveAsync() (supported in versions 2012-08-10)
51
 * @method \Aws\Result listBackups() (supported in versions 2012-08-10)
52
 * @method \GuzzleHttp\Promise\Promise listBackupsAsync() (supported in versions 2012-08-10)
53
 * @method \Aws\Result listGlobalTables() (supported in versions 2012-08-10)
54
 * @method \GuzzleHttp\Promise\Promise listGlobalTablesAsync() (supported in versions 2012-08-10)
55
 * @method \Aws\Result listTagsOfResource() (supported in versions 2012-08-10)
56
 * @method \GuzzleHttp\Promise\Promise listTagsOfResourceAsync() (supported in versions 2012-08-10)
57
 * @method \Aws\Result restoreTableFromBackup() (supported in versions 2012-08-10)
58
 * @method \GuzzleHttp\Promise\Promise restoreTableFromBackupAsync() (supported in versions 2012-08-10)
59
 * @method \Aws\Result tagResource() (supported in versions 2012-08-10)
60
 * @method \GuzzleHttp\Promise\Promise tagResourceAsync() (supported in versions 2012-08-10)
61
 * @method \Aws\Result untagResource() (supported in versions 2012-08-10)
62
 * @method \GuzzleHttp\Promise\Promise untagResourceAsync() (supported in versions 2012-08-10)
63
 * @method \Aws\Result updateGlobalTable() (supported in versions 2012-08-10)
64
 * @method \GuzzleHttp\Promise\Promise updateGlobalTableAsync() (supported in versions 2012-08-10)
65
 * @method \Aws\Result updateTimeToLive() (supported in versions 2012-08-10)
66
 * @method \GuzzleHttp\Promise\Promise updateTimeToLiveAsync() (supported in versions 2012-08-10)
67
// * @method \Aws\Result transactWriteItems()
68
 */
69
class ExecutableQuery
70
{
71
    /**
72
     * @var DynamoDbClient
73
     */
74
    private $client;
75
    /**
76
     * @var array
77
     */
78
    public $query;
79
80
    public function __construct(DynamoDbClient $client, array $query)
81
    {
82
        $this->client = $client;
83
        $this->query = $query;
84
    }
85
86
87
    /**
88
     * @param  string $method
89
     * @param  array $parameters
90
     * @return mixed
91
     */
92
    public function __call($method, $parameters)
93
    {
94
        return $this->client->{$method}($this->query);
95
    }
96
}