Passed
Push — next ( a64239...381d12 )
by Bas
06:24 queued 02:50
created

DatabaseTruncation::setMigrationPaths()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 1
b 0
f 0
nc 4
nop 0
dl 0
loc 13
ccs 7
cts 7
cp 1
crap 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\Aranguent\Testing;
6
7
use Illuminate\Foundation\Testing\DatabaseTruncation as IlluminateDatabaseTruncation;
8
use LaravelFreelancerNL\Aranguent\Testing\Concerns\CanConfigureMigrationCommands;
9
10
trait DatabaseTruncation
11
{
12
    use IlluminateDatabaseTruncation;
13
    use CanConfigureMigrationCommands;
14
15
    /**
16
     * The parameters that should be used when running "migrate:fresh".
17
     *
18
     * Duplicate code because CanConfigureMigrationCommands has a conflict otherwise.
19
     *
20
     * @return array
21
     */
22 1
    protected function migrateFreshUsing()
23
    {
24 1
        $seeder = $this->seeder();
25
26 1
        $results =  array_merge(
27 1
            [
28 1
                '--drop-analyzers' => $this->shouldDropAnalyzers(),
29 1
                '--drop-graphs' => $this->shouldDropGraphs(),
30 1
                '--drop-views' => $this->shouldDropViews(),
31 1
                '--drop-types' => $this->shouldDropTypes(),
32 1
                '--drop-all' => $this->shouldDropAll(),
33 1
            ],
34 1
            $seeder ? ['--seeder' => $seeder] : ['--seed' => $this->shouldSeed()],
35 1
            $this->setMigrationPaths(),
36 1
        );
37
38 1
        return $results;
39
    }
40
}
41