ModelUpdaterBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 23
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 1
A withModel() 0 5 1
1
<?php
2
3
namespace WebTheory\Saveyour\Processor\Builder;
4
5
use WebTheory\Saveyour\Processor\Builder\Abstracts\AbstractModelUpdaterBuilder;
6
use WebTheory\Saveyour\Processor\ModelUpdater;
7
8
class ModelUpdaterBuilder extends AbstractModelUpdaterBuilder
9
{
10
    protected object $model;
11
12
    /**
13
     * @return $this
14
     */
15
    public function withModel(object $model): ModelUpdaterBuilder
16
    {
17
        $this->model = $model;
18
19
        return $this;
20
    }
21
22
    public function build(): ModelUpdater
23
    {
24
        return new ModelUpdater(
25
            $this->name,
26
            $this->fields,
27
            $this->model,
28
            $this->repository,
29
            $this->updateMethod,
0 ignored issues
show
Bug introduced by
It seems like $this->updateMethod can also be of type null; however, parameter $updateMethod of WebTheory\Saveyour\Proce...lUpdater::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
            /** @scrutinizer ignore-type */ $this->updateMethod,
Loading history...
30
            $this->commitMethod,
31
        );
32
    }
33
}
34