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

TableAwareOperationTrait   A

Complexity

Total Complexity 2

Size/Duplication

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
A setTableName() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Contract;
4
5
trait TableAwareOperationTrait
6
{
7
    /**
8
     * @var string The table name.
9
     */
10
    protected $tableName;
11
12
    /**
13
     * Registers the table name with this object.
14
     *
15
     * @param string $tableName The table name.
16
     * @return mixed This object.
17
     */
18 45
    final public function setTableName(string $tableName)
19
    {
20 45
        $this->tableName = $tableName;
21 45
        return $this;
22
    }
23
24 48
    public function toArray(): array
25
    {
26
        return [
27 48
            'TableName' => $this->tableName,
28
        ];
29
    }
30
}
31