QueriedModelDataManager::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 7
dl 0
loc 16
ccs 0
cts 8
cp 0
crap 2
rs 10
c 0
b 0
f 0
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;
0 ignored issues
show
Bug introduced by
The type WebTheory\Saveyour\Enum\ServerRequestLocation was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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