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

shouldDropAnalyzers()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 1
c 1
b 0
f 1
nc 2
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LaravelFreelancerNL\Aranguent\Testing\Concerns;
6
7
trait CanConfigureMigrationCommands
8
{
9
    /**
10
     * Determine if types should be dropped when refreshing the database.
11
     *
12
     * @return array<string, array<string>|string>
13
     */
14 29
    protected function setMigrationPaths()
15
    {
16 29
        $migrationSettings = [];
17
18 29
        if (property_exists($this, 'realPath')) {
19 29
            $migrationSettings['--realpath'] = $this->realPath ?? false;
20
        }
21
22 29
        if (property_exists($this, 'migrationPaths')) {
23 29
            $migrationSettings['--path'] = $this->migrationPaths;
24
        }
25
26 29
        return $migrationSettings;
27
    }
28
29
    /**
30
     * Determine if custom analyzers should be dropped when refreshing the database.
31
     *
32
     * @return bool
33
     */
34 30
    protected function shouldDropAnalyzers()
35
    {
36 30
        return property_exists($this, 'dropAnalyzers') ? $this->dropAnalyzers : false;
37
    }
38
39
    /**
40
     * Determine if graphs should be dropped when refreshing the database.
41
     *
42
     * @return bool
43
     */
44 30
    protected function shouldDropGraphs()
45
    {
46 30
        return property_exists($this, 'dropGraphs') ? $this->dropGraphs : false;
47
    }
48
49
50
    /**
51
     * Determine if all analyzers, graphs and views should be dropped when refreshing the database.
52
     *
53
     * @return bool
54
     */
55 30
    protected function shouldDropAll()
56
    {
57 30
        return property_exists($this, 'dropAll') ? $this->dropAll : false;
58
    }
59
}
60