Passed
Push — master ( 1908fb...8df30e )
by Rougin
03:01
created

Insert::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Rougin\Windstorm\Eloquent;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Rougin\Windstorm\InsertInterface;
7
8
class Insert implements InsertInterface
9
{
10
    /**
11
     * @var \Illuminate\Database\Eloquent\Builder
12
     */
13
    protected $builder;
14
15
    /**
16
     * @var \Rougin\Windstorm\Eloquent\Query
17
     */
18
    protected $query;
19
20
    /**
21
     * Initializes the query instance.
22
     *
23
     * @param \Rougin\Windstorm\Eloquent\Query      $query
24
     * @param \Illuminate\Database\Eloquent\Builder $builder
25
     */
26 6
    public function __construct(Query $query, Builder $builder)
27
    {
28 6
        $this->query = $query;
29
30 6
        $this->builder = $builder;
31 6
    }
32
33
    /**
34
     * Sets the values to be inserted.
35
     *
36
     * @param  array  $data
37
     * @return \Rougin\Windstorm\QueryInterface
38
     */
39 6
    public function values(array $data)
40
    {
41 6
        return $this->query->data($data);
42
    }
43
}
44