MorphOne   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A matchSimple() 0 3 1
1
<?php
2
3
namespace Volosyuk\SimpleEloquent\Relations;
4
5
use Illuminate\Database\Eloquent\Relations\MorphOne as BaseMorphOne;
6
use Illuminate\Support\Collection;
7
8
/**
9
 * Class MorphOneWithSimple
10
 * @package Volosyuk\SimpleEloquent
11
 */
12
class MorphOne extends BaseMorphOne
13
{
14
    use Relation, HasOneOrMany;
15
16
    /**
17
     * Match the eagerly loaded results to their parents.
18
     *
19
     * @param  array   $models
20
     * @param  Collection  $results
21
     * @param  string  $relation
22
     * @return array
23
     */
24 1
    protected function matchSimple(array $models, Collection $results, $relation)
25
    {
26 1
        return $this->matchOneSimple($models, $results, $relation);
27
    }
28
}
29