Issues (7)

src/Data/DB.php (1 issue)

Labels
Severity
1
<?php
2
3
    namespace rAPId\Data;
4
5
    use EasyDb\Core\Config as EasyDbConfig;
6
    use EasyDb\Core\ConnectionPool;
7
    use EasyDb\Core\DB as EasyDb;
8
    use rAPId\Config\Config;
9
10
    class DB
11
    {
12
        /**
13
         * @param string $key
14
         *
15
         * @return EasyDb
16
         */
17
        public static function getDB($key = 'primary') {
18
19
            $config = Config::val("db.$key");
20
            $easy_db_config = new EasyDbConfig($config);
0 ignored issues
show
It seems like $config can also be of type null; however, parameter $config of EasyDb\Core\Config::__construct() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
            $easy_db_config = new EasyDbConfig(/** @scrutinizer ignore-type */ $config);
Loading history...
21
22
            return ConnectionPool::getDbInstance($easy_db_config);
23
        }
24
    }