Generic   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
eloc 13
c 0
b 0
f 0
dl 0
loc 53
rs 10
ccs 0
cts 14
cp 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNextStatuses() 0 7 2
A getLabelSlug() 0 3 1
A initNextStatuses() 0 8 2
A needsAssessment() 0 3 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Properties\Statuses;
4
5
use ByTIC\Models\SmartProperties\Properties\AbstractProperty\Generic as GenericProperty;
6
use ByTIC\Common\Records\Traits\HasStatus\RecordsTrait;
0 ignored issues
show
Bug introduced by
The type ByTIC\Common\Records\Traits\HasStatus\RecordsTrait 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...
7
8
/**
9
 * Class Generic
10
 * @package ByTIC\Common\Records\Statuses
11
 *
12
 * @method RecordsTrait getManager
13
 */
14
abstract class Generic extends GenericProperty
15
{
16
    /**
17
     * @var null|string
18
     */
19
    protected $field = 'status';
20
21
    /**
22
     * @var array
23
     */
24
    protected $next = [];
25
26
    /**
27
     * @var self[]
28
     */
29
    protected $nextStatuses = null;
30
31
    /**
32
     * @return self[]
33
     */
34
    public function getNextStatuses()
35
    {
36
        if ($this->nextStatuses == null) {
37
            $this->initNextStatuses();
38
        }
39
40
        return $this->nextStatuses;
41
    }
42
43
    public function initNextStatuses()
44
    {
45
        $statuses = [];
46
        foreach ($this->next as $next) {
47
            $statuses[] = clone $this->getManager()->getStatus($next);
48
        }
49
50
        $this->nextStatuses = $statuses;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function needsAssessment()
57
    {
58
        return false;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    protected function getLabelSlug()
65
    {
66
        return 'statuses';
67
    }
68
}
69