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

CompilesSqlServerGroupLimit::compileRowNumber()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
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