Completed
Push — master ( a7a349...3fc402 )
by Guillermo A.
03:23
created

DescribeTableOperation   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
rs 10
ccs 5
cts 5
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 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
final class DescribeTableOperation extends AbstractTableAwareOperation
10
{
11
    /**
12
     * {@inheritDoc}
13
     * @link https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-dynamodb-2012-08-10.html#describetable
14
     */
15 2
    public function execute(): ?array
16
    {
17
        try {
18 2
            $result = $this->client->describeTable($this->toArray());
19 1
            return $result['Table'];
20 1
        } catch (DynamoDbException $ex) {
21 1
            throw new Exception($ex->getMessage());
22
        }
23
    }
24
}
25