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

CanLimit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A limit() 0 5 1
A limitAsSql() 0 4 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