Completed
Push — master ( 8f800b...a10bf5 )
by Biao
03:46
created

CoroutineMySQLConnection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getDriverName() 0 3 1
1
<?php
2
3
namespace Hhxsv5\LaravelS\Illuminate\Database;
4
5
use Illuminate\Database\MySqlConnection;
6
7
class CoroutineMySQLConnection extends MySqlConnection
8
{
9
    /**
10
     * The active swoole mysql connection.
11
     *
12
     * @var CoroutineMySQL
13
     */
14
    protected $pdo;
15
16
    /**
17
     * The active swoole mysql used for reads.
18
     *
19
     * @var CoroutineMySQL
20
     */
21
    protected $readPdo;
22
23
    public function __construct($pdo, $database = '', $tablePrefix = '', array $config = [])
24
    {
25
        $this->pdo = $pdo;
26
        $this->database = $database;
27
        $this->tablePrefix = $tablePrefix;
28
        $this->config = $config;
29
        $this->useDefaultQueryGrammar();
30
        $this->useDefaultPostProcessor();
31
    }
32
33
    public function getDriverName()
34
    {
35
        return 'Swoole Coroutine MySQL';
36
    }
37
38
}