WithCriteria   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A apply() 0 4 1
1
<?php
2
3
namespace Ablunier\Laravel\Database\Repository\Eloquent\Criteria;
4
5
use Ablunier\Laravel\Database\Contracts\Repository\Criteria;
6
use Ablunier\Laravel\Database\Contracts\Repository\Repository;
7
8
class WithCriteria implements Criteria
9
{
10
    protected $with = [];
11 3
12
    public function __construct(array $with)
13 3
    {
14 3
        $this->with = $with;
15
    }
16 1
17
    public function apply($model, Repository $repository)
18 1
    {
19
        return $model->with($this->with);
20
    }
21
}
22