Completed
Push — master ( 19c355...d500cb )
by Guillermo A.
02:33
created

ReturnConsumedCapacityAwareOperationTrait   A

Complexity

Total Complexity 2

Size/Duplication

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
A setReturnConsumedCapacity() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Contract;
4
5
use Guillermoandrae\DynamoDb\Constant\ReturnConsumedCapacityOptions;
6
7
trait ReturnConsumedCapacityAwareOperationTrait
8
{
9
    /**
10
     * @var string The level of detail about provisioned throughput consumption that is returned in the response.
11
     */
12
    protected $returnConsumedCapacity = ReturnConsumedCapacityOptions::NONE;
13
14
    /**
15
     * Registers the desired level of consumption detail to return.
16
     *
17
     * @param string $returnConsumedCapacity The level of consumption detail to return.
18
     * @return mixed This object.
19
     */
20 1
    final public function setReturnConsumedCapacity(string $returnConsumedCapacity)
21
    {
22 1
        $this->returnConsumedCapacity = $returnConsumedCapacity;
23 1
        return $this;
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29 18
    public function toArray(): array
30
    {
31
        return [
32 18
            'ReturnConsumedCapacity' => $this->returnConsumedCapacity
33
        ];
34
    }
35
}
36