Passed
Push — master ( 2ea67c...f4db78 )
by Chris
39:33
created

QueriedModelDataManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
1
<?php
2
3
namespace WebTheory\Saveyour\Data;
4
5
use WebTheory\Saveyour\Abstracts\QueriesRepositoryTrait;
6
use WebTheory\Saveyour\Contracts\Data\FieldDataManagerInterface;
7
use WebTheory\Saveyour\Data\Abstracts\AbstractQueriedModelDataManager;
8
use WebTheory\Saveyour\Data\Abstracts\ManagesModelTrait;
9
use WebTheory\Saveyour\Enum\ServerRequestLocation;
10
11
class QueriedModelDataManager extends AbstractQueriedModelDataManager implements FieldDataManagerInterface
12
{
13
    use ManagesModelTrait;
14
    use QueriesRepositoryTrait;
15
16
    public function __construct(
17
        object $repository,
18
        string $queryMethod,
19
        string $getMethod,
20
        string $setMethod,
21
        string $lookup,
22
        ?ServerRequestLocation $location = null,
23
        ?string $updateMethod = null
24
    ) {
25
        $this->repository = $repository;
26
        $this->queryMethod = $queryMethod;
27
        $this->getMethod = $getMethod;
28
        $this->setMethod = $setMethod;
29
        $this->lookup = $lookup;
30
        $this->location = $location ?? ServerRequestLocation::Attribute();
31
        $this->updateMethod = $updateMethod;
32
    }
33
}
34