Passed
Push — master ( 5ad58b...7269b1 )
by Chris
07:31
created

AbstractPropertyBasedCollectionComparator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setProperty() 0 5 1
1
<?php
2
3
namespace WebTheory\Collection\Comparison\Abstracts;
4
5
use WebTheory\Collection\Contracts\CollectionComparatorInterface;
6
use WebTheory\Collection\Contracts\PropertyResolverInterface;
7
use WebTheory\Collection\Resolution\Abstracts\ResolvesPropertyValueTrait;
8
9
abstract class AbstractPropertyBasedCollectionComparator extends AbstractCollectionComparator implements CollectionComparatorInterface
10
{
11
    use ResolvesPropertyValueTrait;
12
13 90
    public function __construct(PropertyResolverInterface $propertyResolver)
14
    {
15 90
        $this->propertyResolver = $propertyResolver;
16
    }
17
18 12
    public function setProperty(string $property): AbstractPropertyBasedCollectionComparator
19
    {
20 12
        $this->property = $property;
21
22 12
        return $this;
23
    }
24
}
25