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

CompilesFirebirdExpressions   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A compileInsertUsing() 0 5 1
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