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