DescribeTableOperation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
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 9
ccs 5
cts 5
cp 1
rs 10

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\AbstractTableOperation;
7
use Guillermoandrae\DynamoDb\Factory\ExceptionFactory;
8
9
/**
10
 * DescribeTable operation.
11
 *
12
 * @author Guillermo A. Fisher <[email protected]>
13
 * @link https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-dynamodb-2012-08-10.html#describetable
14
 */
15
final class DescribeTableOperation extends AbstractTableOperation
16
{
17 2
    public function execute(): ?array
18
    {
19
        try {
20 2
            $result = $this->client->describeTable($this->toArray());
21 1
            return $result['Table'];
22 1
        } catch (DynamoDbException $ex) {
23 1
            throw ExceptionFactory::factory($ex);
24
        }
25
    }
26
}
27