Driver   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 60
ccs 0
cts 23
cp 0
rs 10
wmc 11

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getConnectionName() 0 3 1
A isMongoDB() 0 3 2
A isSqlsrv() 0 3 2
A isSqlite() 0 3 2
A isPostgresql() 0 3 2
A isMysql() 0 3 2
1
<?php
2
3
namespace CodexShaper\DBM\Database\Drivers;
4
5
class Driver
6
{
7
    /**
8
     * Get connection name.
9
     *
10
     * @return string
11
     */
12
    public function getConnectionName()
13
    {
14
        return config('database.default', 'mysql');
15
    }
16
17
    /**
18
     * Check driver is MongoDB.
19
     *
20
     * @return bool
21
     */
22
    public function isMongoDB()
23
    {
24
        return (config('database.default') == 'mongodb') ? true : false;
25
    }
26
27
    /**
28
     * Check driver is Mysql.
29
     *
30
     * @return bool
31
     */
32
    public function isMysql()
33
    {
34
        return (config('database.default') == 'mysql') ? true : false;
35
    }
36
37
    /**
38
     * Check driver is Postgresql.
39
     *
40
     * @return bool
41
     */
42
    public function isPostgresql()
43
    {
44
        return (config('database.default') == 'pgsql') ? true : false;
45
    }
46
47
    /**
48
     * Check driver is Sqlsrv.
49
     *
50
     * @return bool
51
     */
52
    public function isSqlsrv()
53
    {
54
        return (config('database.default') == 'sqlsrv') ? true : false;
55
    }
56
57
    /**
58
     * Check driver is Sqlite.
59
     *
60
     * @return bool
61
     */
62
    public function isSqlite()
63
    {
64
        return (config('database.default') == 'sqlite') ? true : false;
65
    }
66
}
67