SQLiteConnection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 28
c 0
b 0
f 0
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultSchemaGrammar() 0 3 1
A getSchemaBuilder() 0 10 1
1
<?php
2
3
namespace ShiftOneLabs\LaravelNomad\Extension\Database;
4
5
use Illuminate\Database\SQLiteConnection as BaseSQLiteConnection;
6
use ShiftOneLabs\LaravelNomad\Extension\Database\Schema\Blueprint;
7
use ShiftOneLabs\LaravelNomad\Extension\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar;
8
9
class SQLiteConnection extends BaseSQLiteConnection
10
{
11
12
    /**
13
     * Get the default schema grammar instance.
14
     *
15
     * @return \ShiftOneLabs\LaravelNomad\Extension\Database\Schema\Grammars\SQLiteGrammar
16
     */
17 402
    protected function getDefaultSchemaGrammar()
18
    {
19 402
        return $this->withTablePrefix(new SchemaGrammar());
20
    }
21
22
    /**
23
     * Get a schema builder instance for the connection.
24
     *
25
     * @return \Illuminate\Database\Schema\Builder
26
     */
27 67
    public function getSchemaBuilder()
28
    {
29 67
        $parentBuilder = parent::getSchemaBuilder();
30
31
        // add a blueprint resolver closure that returns the custom blueprint
32 67
        $parentBuilder->blueprintResolver(function ($table, $callback) {
33 67
            return new Blueprint($table, $callback);
34 67
        });
35
36 67
        return $parentBuilder;
37
    }
38
}
39