Completed
Push — master ( 65b043...dd1ab4 )
by Guillermo A.
02:55
created

AbstractTableOperation   A

Complexity

Total Complexity 2

Size/Duplication

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Contract;
4
5
use Aws\DynamoDb\DynamoDbClient;
6
use Aws\DynamoDb\Marshaler;
7
8
/**
9
 * Abstract for table operations.
10
 *
11
 * @author Guillermo A. Fisher <[email protected]>
12
 */
13
abstract class AbstractTableOperation extends AbstractOperation implements TableOperationInterface
14
{
15
    use TableAwareOperationTrait {
16
        TableAwareOperationTrait::toArray as tableAwareTraitToArray;
17
    }
18
19
    /**
20
     * Registers the DynamoDb client, Marshaler, and the table name with this object.
21
     *
22
     * @param DynamoDbClient $client The DynamoDb client.
23
     * @param Marshaler $marshaler The Marshaler.
24
     * @param string $tableName The table name.
25
     */
26 24
    public function __construct(DynamoDbClient $client, Marshaler $marshaler, string $tableName)
27
    {
28 24
        parent::__construct($client, $marshaler);
29 24
        $this->setTableName($tableName);
30 24
    }
31
32 34
    public function toArray(): array
33
    {
34 34
        return $this->tableAwareTraitToArray();
35
    }
36
}
37