HasManagerTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
eloc 6
dl 0
loc 33
ccs 3
cts 7
cp 0.4286
rs 10
c 1
b 1
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setManager() 0 5 1
A hasManager() 0 3 1
A getManager() 0 3 1
1
<?php
2
3
namespace ByTIC\Models\SmartProperties\Properties\AbstractProperty\Traits;
4
5
use ByTIC\Common\Records\Traits\I18n\RecordsTrait as RecordsTranslated;
0 ignored issues
show
Bug introduced by
The type ByTIC\Common\Records\Traits\I18n\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...
6
use ByTIC\Common\Records\Traits\AbstractTrait\RecordsTrait;
0 ignored issues
show
Bug introduced by
The type ByTIC\Common\Records\Tra...tractTrait\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
use ByTIC\Common\Records\Traits\HasTypes\RecordsTrait as HasTypesRecords;
0 ignored issues
show
Bug introduced by
The type ByTIC\Common\Records\Traits\HasTypes\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...
8
use Nip\Records\RecordManager as Records;
9
10
/**
11
 * Trait HasManagerTrait
12
 * @package ByTIC\Models\SmartProperties\Properties\AbstractProperty\Traits
13
 */
14
trait HasManagerTrait
15
{
16
    /**
17
     * @var null|Records|RecordsTranslated|HasTypesRecords
18
     */
19
    protected $manager;
20
21
22
    /**
23
     * @return Records|RecordsTranslated|HasTypesRecords
24
     */
25
    public function getManager()
26
    {
27
        return $this->manager;
28
    }
29
30
    /**
31
     * @param Records|RecordsTrait $manager
32
     * @return $this
33
     */
34 14
    public function setManager($manager)
35
    {
36 14
        $this->manager = $manager;
37
38 14
        return $this;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function hasManager()
45
    {
46
        return $this->manager instanceof Records;
47
    }
48
}
49