Passed
Push — master ( 25382b...1e7063 )
by Jonas
03:52 queued 01:29
created

CompilesSqlServerExpressions::compileTableExpression()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Staudenmeir\LaravelCte\Query\Grammars\Traits;
4
5
use Illuminate\Database\Query\Builder;
6
7
trait CompilesSqlServerExpressions
8
{
9
    use CompilesExpressions {
10
        compileSelect as compileSelectParent;
11
    }
12
13
    /**
14
     * Compile a select query into SQL.
15
     *
16
     * @param \Illuminate\Database\Query\Builder $query
17
     * @return string
18
     */
19 52
    public function compileSelect(Builder $query)
20
    {
21 52
        if ($query->offset && empty($query->orders)) {
22 6
            $query->orders[] = ['sql' => '(SELECT 0)'];
23
        }
24
25 52
        return $this->compileSelectParent($query);
26
    }
27
28
    /**
29
     * Get the "recursive" keyword.
30
     *
31
     * @param array $expressions
32
     * @return string
33
     */
34
    protected function recursiveKeyword(array $expressions)
0 ignored issues
show
Unused Code introduced by
The parameter $expressions is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    protected function recursiveKeyword(/** @scrutinizer ignore-unused */ array $expressions)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36
        return '';
37
    }
38
}
39