Completed
Push — master ( 5dcd9d...c14981 )
by Christopher
03:44 queued 02:23
created

MysqlVirtualConnection::getDefaultSchemaGrammar()   A

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 Illuminate\Database\Schema\MySqlBuilder;
5
use Illuminate\Database\Query\Processors\MySqlProcessor;
6
use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver;
7
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar;
8
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar;
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 (is_null($this->schemaGrammar))
20
                {
21
                        $this->useDefaultSchemaGrammar();
22
                }
23
                return new MySqlBuilder($this);
24
        }
25
        /**
26
         * Get the default query grammar instance.
27
         *
28
         * @return \Illuminate\Database\Query\Grammars\MySqlGrammar
29
         */
30
        protected function getDefaultQueryGrammar()
31
        {
32
                return $this->withTablePrefix(new QueryGrammar);
33
        }
34
        /**
35
         * Get the default schema grammar instance.
36
         *
37
         * @return \Illuminate\Database\Schema\Grammars\MySqlGrammar
38
         */
39
        protected function getDefaultSchemaGrammar()
40
        {
41
                return $this->withTablePrefix(new SchemaGrammar);
42
        }
43
        /**
44
         * Get the default post processor instance.
45
         *
46
         * @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...
47
         */
48
        protected function getDefaultPostProcessor()
49
        {
50
                return new MySqlProcessor;
51
        }
52
        /**
53
         * Get the Doctrine DBAL driver.
54
         *
55
         * @return \Doctrine\DBAL\Driver\PDOMySql\Driver
56
         */
57
        protected function getDoctrineDriver()
58
        {
59
                return new DoctrineDriver;
60
        }
61
}
62
63
64
65