public static function getDBHelper(string $driver): string
    {
        $drivers = [
            'pdo_mysql'  => MySQL::class,
            'mysql'      => MySQL::class,
            'mysql2'     => MySQL::class,

            'pdo_pgsql'  => PostgreSQL::class,
            'pgsql'      => PostgreSQL::class,
            'postgres'   => PostgreSQL::class,
            'postgresql' => PostgreSQL::class,

            'pdo_sqlsrv' => SQLServer::class,
            'mssql'      => SQLServer::class,
        ];

        if (!array_key_exists($driver, $drivers)) {
            throw new \InvalidArgumentException("$driver unknown");
        }

        return $drivers[$driver];
    }
public static function getDBHelper(string $driver): string
    {
        $drivers = [
            'pdo_mysql'  => MySQL::class,
            'mysql'      => MySQL::class,
            'mysql2'     => MySQL::class,

            'pdo_pgsql'  => PostgreSQL::class,
            'pgsql'      => PostgreSQL::class,
            'postgres'   => PostgreSQL::class,
            'postgresql' => PostgreSQL::class,

            'pdo_sqlsrv' => SQLServer::class,
            'mssql'      => SQLServer::class,
        ];

        if (!array_key_exists($driver, $drivers)) {
            throw new \InvalidArgumentException("$driver unknown");
        }

        return $drivers[$driver];
    }
public static function getDBHelper ( string $ driver ) : string { $ drivers = [ 'pdo_mysql' => MySQL :: class , 'mysql' => MySQL :: class , 'mysql2' => MySQL :: class , 'pdo_pgsql' => PostgreSQL :: class , 'pgsql' => PostgreSQL :: class , 'postgres' => PostgreSQL :: class , 'postgresql' => PostgreSQL :: class , 'pdo_sqlsrv' => SQLServer :: class , 'mssql' => SQLServer :: class , ] ; if ( ! array_key_exists ( $ driver , $ drivers ) ) { throw new \ InvalidArgumentException ( "$driver unknown" ) ; } return $ drivers [ $ driver ] ; }
Find the right local driver from a php extension

@param  string $driver

@throws \InvalidArgumentException

@return string
Find the right local driver from a php extension