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

WithCriteria   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A apply() 0 4 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