Passed
Push — master ( b995c8...f308d3 )
by Jonas
08:58 queued 06:15
created

CompilesFirebirdExpressions::compileInsertUsing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Staudenmeir\LaravelCte\Query\Grammars\Traits;
4
5
use Illuminate\Database\Query\Builder;
6
7
trait CompilesFirebirdExpressions
8
{
9
    use CompilesExpressions;
10
11
    /**
12
     * Compile an insert statement using a subquery into SQL.
13
     *
14
     * @param \Illuminate\Database\Query\Builder $query
15
     * @param array $columns
16
     * @param string $sql
17
     * @return string
18
     */
19
    public function compileInsertUsing(Builder $query, array $columns, string $sql)
20
    {
21
        $insert = "insert into {$this->wrapTable($query->from)} ({$this->columnize($columns)}) ";
0 ignored issues
show
Bug introduced by
It seems like columnize() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

21
        $insert = "insert into {$this->wrapTable($query->from)} ({$this->/** @scrutinizer ignore-call */ columnize($columns)}) ";
Loading history...
Bug introduced by
It seems like wrapTable() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

21
        $insert = "insert into {$this->/** @scrutinizer ignore-call */ wrapTable($query->from)} ({$this->columnize($columns)}) ";
Loading history...
22
23
        return "$insert{$this->compileExpressions($query, $query->expressions)} $sql";
0 ignored issues
show
Bug introduced by
The property expressions does not seem to exist on Illuminate\Database\Query\Builder.
Loading history...
24
    }
25
}
26