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

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