Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class ListTablesOperation extends AbstractOperation |
||
12 | { |
||
13 | use LimitAwareOperationTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string The name of the last table in the current page of results. |
||
17 | */ |
||
18 | protected $lastEvaluatedTableName; |
||
19 | |||
20 | /** |
||
21 | * Registers the name of table to be used as the last in the current page of results. |
||
22 | * |
||
23 | * @param string $lastEvaluatedTableName The name of the last table in the current page of results. |
||
24 | * @return ListTablesOperation This object. |
||
25 | */ |
||
26 | 1 | public function setLastEvaluatedTableName(string $lastEvaluatedTableName): ListTablesOperation |
|
27 | { |
||
28 | 1 | $this->lastEvaluatedTableName = $lastEvaluatedTableName; |
|
29 | 1 | return $this; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritDoc} |
||
34 | */ |
||
35 | 19 | public function toArray(): array |
|
36 | { |
||
37 | 19 | $query = []; |
|
38 | 19 | if ($this->lastEvaluatedTableName) { |
|
39 | 1 | $query['LastEvaluatedTableName'] = $this->lastEvaluatedTableName; |
|
40 | } |
||
41 | 19 | if ($this->limit) { |
|
42 | 1 | $query['Limit'] = $this->limit; |
|
43 | } |
||
44 | 19 | return $query; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritDoc} |
||
49 | */ |
||
50 | 17 | public function execute(): ?array |
|
54 | } |
||
55 | } |
||
56 |