Issues (12)

src/DB/DB.php (2 issues)

Labels
Severity
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
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
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
}