HasManagers   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 33
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0
wmc 9

3 Methods

Rating   Name   Duplication   Size   Complexity  
A admin() 0 7 3
A schema() 0 7 3
A monitor() 0 7 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArangoClient;
6
7
use ArangoClient\Admin\AdminManager;
8
use ArangoClient\Monitor\MonitorManager;
9
use ArangoClient\Schema\SchemaManager;
10
11
trait HasManagers
12
{
13
    protected ?AdminManager $adminManager = null;
14
15
    protected ?MonitorManager $monitorManager = null;
16
17
    protected ?SchemaManager $schemaManager = null;
18
19 9
    public function admin(): AdminManager
20
    {
21 9
        if (!(property_exists($this, 'adminManager') && $this->adminManager !== null)) {
22 9
            $this->adminManager = new AdminManager($this);
23
        }
24
25 9
        return $this->adminManager;
26
    }
27
28 1
    public function monitor(): MonitorManager
29
    {
30 1
        if (!(property_exists($this, 'monitorManager') && $this->monitorManager !== null)) {
31 1
            $this->monitorManager = new MonitorManager($this);
32
        }
33
34 1
        return $this->monitorManager;
35
    }
36
37 117
    public function schema(): SchemaManager
38
    {
39 117
        if (!(property_exists($this, 'schemaManager') && $this->schemaManager !== null)) {
40 117
            $this->schemaManager = new SchemaManager($this);
41
        }
42
43 117
        return $this->schemaManager;
44
    }
45
}
46