Completed
Push — master ( ee9403...effd37 )
by Guillermo A.
02:12
created

DeleteTableOperation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 2
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Operation;
4
5
use Aws\DynamoDb\Exception\DynamoDbException;
6
use Guillermoandrae\DynamoDb\Contract\AbstractTableAwareOperation;
7
use Guillermoandrae\DynamoDb\Exception;
8
9
/**
10
 * @link https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-dynamodb-2012-08-10.html#deletetable
11
 */
12
final class DeleteTableOperation extends AbstractTableAwareOperation
13
{
14
    /**
15
     * {@inheritDoc}
16
     */
17 8
    public function execute(): bool
18
    {
19
        try {
20 8
            $this->client->deleteTable($this->toArray());
21
            //$this->client->waitUntil('TableExists', ['TableName' => $this->tableName]);
22 7
            return true;
23 1
        } catch (DynamoDbException $ex) {
24 1
            throw new Exception($ex->getMessage());
25
        }
26
    }
27
}
28