Insert   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
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 34
ccs 6
cts 6
cp 1
rs 10

2 Methods

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