Completed
Push — master ( 7723f5...13b1e1 )
by Adrian
16:41 queued 09:58
created

WithCriteria::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
namespace Ablunier\Laravel\Database\Repository\Eloquent\Criteria;
3
4
use Ablunier\Laravel\Database\Contracts\Repository\Criteria;
5
use Ablunier\Laravel\Database\Contracts\Repository\Repository;
6
7
class WithCriteria implements Criteria
8
{
9
    protected $with = array();
10
11 3
    public function __construct(array $with)
12
    {
13 3
        $this->with = $with;
14 3
    }
15
16 1
    public function apply($model, Repository $repository)
17
    {
18 1
        return $model->with($this->with);
19
    }
20
}
21