PostgresConnection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 36.36%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 5
c 4
b 0
f 0
lcom 1
cbo 5
dl 0
loc 48
ccs 4
cts 11
cp 0.3636
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSchemaBuilder() 0 8 2
A getDefaultQueryGrammar() 0 4 1
A getDefaultSchemaGrammar() 0 4 1
A getDefaultPostProcessor() 0 4 1
1
<?php namespace Bosnadev\Database;
2
3
use Illuminate\Database\PostgresConnection as BasePostgresConnection;
4
5
/**
6
 * Class PostgresConnection
7
 *
8
 * @package Bosnadev\Database
9
 */
10
class PostgresConnection extends BasePostgresConnection
11
{
12
    /**
13
     * Get a schema builder instance for the connection.
14
     *
15
     * @return Schema\Builder
16
     */
17
    public function getSchemaBuilder()
18
    {
19
        if (is_null($this->schemaGrammar)) {
20
            $this->useDefaultSchemaGrammar();
21
        }
22
23
        return new Schema\Builder($this);
24
    }
25
26
    /**
27
     * Get the default query grammar instance.
28
     *
29
     * @return \Illuminate\Database\Grammar
30
     */
31 3
    protected function getDefaultQueryGrammar()
32
    {
33 3
        return $this->withTablePrefix(new Query\Grammars\PostgresGrammar);
34
    }
35
36
37
    /**
38
     * Get the default schema grammar instance.
39
     *
40
     * @return \Illuminate\Database\Grammar
41
     */
42
    protected function getDefaultSchemaGrammar()
43
    {
44
        return $this->withTablePrefix(new Schema\Grammars\PostgresGrammar);
45
    }
46
47
48
    /**
49
     * Get the default post processor instance.
50
     *
51
     * @return \Illuminate\Database\Query\Processors\PostgresProcessor
52
     */
53 3
    protected function getDefaultPostProcessor()
54
    {
55 3
        return new \Illuminate\Database\Query\Processors\PostgresProcessor;
56
    }
57
}
58