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

DatabaseMigrations::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\DatabaseMigrations as IlluminateDatabaseMigrations;
8
use LaravelFreelancerNL\Aranguent\Testing\Concerns\CanConfigureMigrationCommands;
9
10
trait DatabaseMigrations
11
{
12
    use IlluminateDatabaseMigrations;
13
    use CanConfigureMigrationCommands;
14
15
16
    /**
17
     * The parameters that should be used when running "migrate:fresh".
18
     *
19
     * Duplicate code because CanConfigureMigrationCommands has a conflict otherwise.
20
     *
21
     * @return array
22
     */
23 28
    protected function migrateFreshUsing()
24
    {
25 28
        $seeder = $this->seeder();
26
27 28
        $results =  array_merge(
28 28
            [
29 28
                '--drop-analyzers' => $this->shouldDropAnalyzers(),
30 28
                '--drop-graphs' => $this->shouldDropGraphs(),
31 28
                '--drop-views' => $this->shouldDropViews(),
32 28
                '--drop-types' => $this->shouldDropTypes(),
33 28
                '--drop-all' => $this->shouldDropAll(),
34 28
            ],
35 28
            $seeder ? ['--seeder' => $seeder] : ['--seed' => $this->shouldSeed()],
36 28
            $this->setMigrationPaths(),
37 28
        );
38
39 28
        return $results;
40
    }
41
}
42