DB   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A Database() 0 7 4
1
<?php
2
declare(strict_types=1);
3
4
namespace DyarWeb\DB;
5
6
/**
7
 * Class DB
8
 * @package DyarWeb
9
 */
10
class DB
11
{
12
    public static $instance;
13
14
    /**
15
     * @return Json|MongoDB|Mysql
16
     */
17
18
    public static function Database()
19
    {
20
        $DB = getenv('DB');
21
        if     ($DB == 'json') self::$instance = new Json();
22
        elseif ($DB == 'mysql') self::$instance = new Mysql();
0 ignored issues
show
Bug introduced by
The type DyarWeb\DB\Mysql 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...
23
        elseif ($DB == 'mongodb') self::$instance = new MongoDB();
0 ignored issues
show
Bug introduced by
The type DyarWeb\DB\MongoDB was not found. Did you mean MongoDB? If so, make sure to prefix the type with \.
Loading history...
24
        return self::$instance;
25
26
    }
27
}