Completed
Push — master ( 3efc16...d615e7 )
by Woody
12s
created

CanLimit::limitAsSql()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Latitude\QueryBuilder\Traits;
5
6
trait CanLimit
7
{
8 3
    public function limit(int $limit): self
9
    {
10 3
        $this->limit = $limit;
11 3
        return $this;
12
    }
13
14 3
    protected function limitAsSql(): string
15
    {
16 3
        return sprintf('LIMIT %d', $this->limit);
17
    }
18
19
    /**
20
     * @var int
21
     */
22
    protected $limit;
23
}
24