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

CommandAbstract   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 37
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A addFile() 0 6 2
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