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

LimitAwareOperationTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setLimit() 0 4 1
A toArray() 0 4 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Contract;
4
5
trait LimitAwareOperationTrait
6
{
7
    /**
8
     * @var int The result limit.
9
     */
10
    protected $limit;
11
12
    /**
13
     * Registers the result limit with this object.
14
     *
15
     * @param integer $limit The result limit.
16
     * @return mixed An implementation of this trait.
17
     */
18 2
    final public function setLimit(int $limit)
19
    {
20 2
        $this->limit = $limit;
21 2
        return $this;
22
    }
23
24
    /**
25
     * {@inheritDoc}
26
     */
27 2
    public function toArray(): array
28
    {
29
        return [
30 2
            'Limit' => $this->limit
31
        ];
32
    }
33
}
34