Passed
Push — main ( e0d381...c6e32b )
by Pranjal
02:29
created

Managers   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 10
c 1
b 1
f 0
dl 0
loc 30
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A recordManager() 0 3 1
A __construct() 0 2 1
A create() 0 4 1
A modelManager() 0 3 1
A tableManager() 0 3 1
1
<?php 
2
declare(strict_types=1);
3
4
namespace Scrawler\Arca;
5
use \Doctrine\DBAL\Connection;
0 ignored issues
show
Bug introduced by
The type \Doctrine\DBAL\Connection 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 Scrawler\Arca\Manager\ModelManager;
7
use Scrawler\Arca\Manager\RecordManager;
8
use Scrawler\Arca\Manager\TableManager;
9
10
11
class Managers{
12
    private static TableManager $tableManager;
13
    private static RecordManager $recordManager;
14
15
    private static ModelManager $modelManager;
16
17
    private function __construct()
18
    {
19
        
20
    }
21
22
    public static function create(Connection $connection, bool $isUsingUUID = false){
23
        self::$tableManager = new TableManager($connection,$isUsingUUID);
24
        self::$recordManager = new RecordManager($connection,$isUsingUUID);
25
        self::$modelManager = new ModelManager();
26
    }
27
28
    public static function tableManager(): TableManager
29
    {
30
        return self::$tableManager;
31
    }
32
33
    public static function recordManager() : RecordManager
34
    {
35
        return self::$recordManager;
36
    }
37
38
    public static function modelManager() : ModelManager
39
    {
40
        return self::$modelManager;
41
    }
42
}