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

TableAwareOperationTrait::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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