Passed
Push — master ( c9b334...7badbc )
by Ryosuke
12:43 queued 02:43
created

SqlServerGrammar   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
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10

1 Method

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