Completed
Push — master ( 97351b...ccece0 )
by Adrian
04:00
created

WithCriteria::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
namespace ANavallaSuiza\Laravel\Database\Repository\Eloquent\Criteria;
3
4
use ANavallaSuiza\Laravel\Database\Contracts\Repository\Criteria;
5
use ANavallaSuiza\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