Completed
Push — master ( 20a668...02e94f )
by Guillermo A.
02:17
created

ListTablesRequest::setLastEvaluatedTableName()   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
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb;
4
5
final class ListTablesRequest extends AbstractRequest
6
{
7
    use LimitAwareRequestTrait;
8
9
    /**
10
     * @var string The name of the last table in the current page of results.
11
     */
12
    protected $lastEvaluatedTableName;
13
14
    /**
15
     * Registers the name of table to be used as the last in the current page of results.
16
     *
17
     * @param string $lastEvaluatedTableName The name of the last table in the current page of results.
18
     * @return ListTablesRequest This object.
19
     */
20 1
    public function setLastEvaluatedTableName(string $lastEvaluatedTableName): ListTablesRequest
21
    {
22 1
        $this->lastEvaluatedTableName = $lastEvaluatedTableName;
23 1
        return $this;
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29 21
    public function get(): array
30
    {
31 21
        $query = [];
32 21
        if ($this->lastEvaluatedTableName) {
33 1
            $query['LastEvaluatedTableName'] = $this->lastEvaluatedTableName;
34
        }
35 21
        if ($this->limit) {
36 1
            $query['Limit'] = $this->limit;
37
        }
38 21
        return $query;
39
    }
40
}
41