MysqlVirtualConnection::getDoctrineDriver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace AlgoWeb\ModelViews\Database;
3
4
use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver;
5
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar;
6
use Illuminate\Database\Query\Processors\MySqlProcessor;
7
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar;
8
use Illuminate\Database\Schema\MySqlBuilder;
9
10
class MysqlVirtualConnection extends Connection
11
{
12
    /**
13
     * Get a schema builder instance for the connection.
14
     *
15
     * @return \Illuminate\Database\Schema\MySqlBuilder
16
     */
17
    public function getSchemaBuilder()
18
    {
19
        if (null === $this->schemaGrammar) {
20
            $this->useDefaultSchemaGrammar();
21
        }
22
        return new MySqlBuilder($this);
23
    }
24
    /**
25
     * Get the default query grammar instance.
26
     *
27
     * @return \Illuminate\Database\Query\Grammars\MySqlGrammar
28
     */
29
    protected function getDefaultQueryGrammar()
30
    {
31
        return $this->withTablePrefix(new QueryGrammar);
32
    }
33
    /**
34
     * Get the default schema grammar instance.
35
     *
36
     * @return \Illuminate\Database\Schema\Grammars\MySqlGrammar
37
     */
38
    protected function getDefaultSchemaGrammar()
39
    {
40
        return $this->withTablePrefix(new SchemaGrammar);
41
    }
42
    /**
43
     * Get the default post processor instance.
44
     *
45
     * @return \Illuminate\Database\Query\Processors\Processor
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use MySqlProcessor.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
46
     */
47
    protected function getDefaultPostProcessor()
48
    {
49
        return new MySqlProcessor;
50
    }
51
    /**
52
     * Get the Doctrine DBAL driver.
53
     *
54
     * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
55
     */
56
    protected function getDoctrineDriver()
57
    {
58
        return new DoctrineDriver;
59
    }
60
}
61