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

AbstractTableOperation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 3
crap 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