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

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