MysqlVirtualConnection   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 6
c 1
b 1
f 0
lcom 1
cbo 5
dl 0
loc 51
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getDoctrineDriver() 0 4 1
A getSchemaBuilder() 0 7 2
A getDefaultQueryGrammar() 0 4 1
A getDefaultSchemaGrammar() 0 4 1
A getDefaultPostProcessor() 0 4 1
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