FinderMakeCommand::getStub()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 0
cts 4
cp 0
crap 6
rs 10
1
<?php
2
3
namespace Terranet\Administrator\Console;
4
5
use Illuminate\Console\GeneratorCommand;
0 ignored issues
show
Bug introduced by
The type Illuminate\Console\GeneratorCommand was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Component\Console\Input\InputOption;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Console\Input\InputOption was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class FinderMakeCommand extends GeneratorCommand
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $name = 'administrator:finder';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Create new administrator module finder service.';
23
24
    /**
25
     * The type of class being generated.
26
     *
27
     * @var string
28
     */
29
    protected $type = 'Finder';
30
31
    /**
32
     * Get the stub file for the generator.
33
     *
34
     * @return string
35
     */
36
    protected function getStub()
37
    {
38
        if ($this->option('plain')) {
39
            return __DIR__.'/stubs/finder.plain.stub';
40
        }
41
42
        return __DIR__.'/stubs/finder.stub';
43
    }
44
45
    /**
46
     * Get the default namespace for the class.
47
     *
48
     * @param string $rootNamespace
49
     *
50
     * @return string
51
     */
52
    protected function getDefaultNamespace($rootNamespace)
53
    {
54
        return $rootNamespace.'\\'.config('administrator.paths.finder');
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

54
        return $rootNamespace.'\\'./** @scrutinizer ignore-call */ config('administrator.paths.finder');
Loading history...
55
    }
56
57
    /**
58
     * Get the console command options.
59
     *
60
     * @return array
61
     */
62
    protected function getOptions()
63
    {
64
        return [
65
            ['plain', null, InputOption::VALUE_NONE, 'Generate an empty finder class.'],
66
        ];
67
    }
68
}
69