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

AbstractPropertyBasedSorter::setProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace WebTheory\Collection\Sorting\Abstracts;
4
5
use WebTheory\Collection\Contracts\PropertyResolverInterface;
6
use WebTheory\Collection\Resolution\Abstracts\ResolvesPropertyValueTrait;
7
8
abstract class AbstractPropertyBasedSorter extends AbstractSorter
9
{
10
    use ResolvesPropertyValueTrait;
11
12
    protected string $property;
13
14 90
    public function __construct(PropertyResolverInterface $resolver)
15
    {
16 90
        $this->propertyResolver = $resolver;
17
    }
18
19 18
    public function setProperty(string $property): AbstractPropertyBasedSorter
20
    {
21 18
        $this->property = $property;
22
23 18
        return $this;
24
    }
25
}
26