Passed
Push — master ( da32e1...5d84d6 )
by Thomas
02:58
created

CommandAbstract::addFile()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Contracts;
4
5
use Illuminate\Console\Command;
6
7
abstract class CommandAbstract extends Command
8
{
9
    /**
10
     * Paths to files which should automatically be opened in IDE if the
11
     * option --ide is set (and IDE capable).
12
     *
13
     * @var array
14
     */
15
    public $filesToBeOpened = [];
16
17
    /**
18
     * The name of the entity being created.
19
     *
20
     * @var string
21
     */
22
    public $entity;
23
24
    /**
25
     * The naming classes.
26
     *
27
     * @var array
28
     */
29
    public $naming = [];
30
31
    /**
32
     * Adds file to $filesToBeOpened stack.
33
     *
34
     * @param $file
35
     * @return void
36
     */
37
    public function addFile(?\SplFileInfo $file): void
38
    {
39
        if ($file) {
40
            array_push($this->filesToBeOpened, $file);
41
        }
42
    }
43
}
44