Sqlite::dropAllTables()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
namespace Spatie\MigrateFresh\TableDroppers;
4
5
use Illuminate\Support\Facades\DB;
6
7
class Sqlite implements TableDropper
8
{
9
    public function dropAllTables()
10
    {
11
        $dbPath = DB::getConfig('database');
12
13
        if ($dbPath === ':memory:') {
14
            return;
15
        }
16
17
        if (file_exists($dbPath)) {
18
            unlink($dbPath);
19
        }
20
21
        touch($dbPath);
22
    }
23
}
24