Passed
Push — master ( 0d1e3a...a8104a )
by Jonas
11:45
created

CompilesSqlServerGroupLimit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A compileRowNumber() 0 7 2
1
<?php
2
3
namespace Staudenmeir\EloquentEagerLimit\Grammars\Traits;
4
5
trait CompilesSqlServerGroupLimit
6
{
7
    use CompilesGroupLimit {
8
        compileRowNumber as compileRowNumberParent;
9
    }
10
11
    /**
12
     * Compile a row number clause.
13
     *
14
     * @param string $partition
15
     * @param string $orders
16
     * @return string
17
     */
18 28
    protected function compileRowNumber($partition, $orders)
19
    {
20 28
        if (empty($orders)) {
21 4
            $orders = 'order by (select 0)';
22
        }
23
24 28
        return $this->compileRowNumberParent($partition, $orders);
25
    }
26
}
27