GetVariable::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Fomvasss\Variable\Commands;
4
5
use Illuminate\Console\Command;
0 ignored issues
show
Bug introduced by
The type Illuminate\Console\Command 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
7
class GetVariable extends Command
8
{
9
    protected $signature = 'variable:get
10
                {key : The variable key}
11
                {--langcode= : The language code}
12
                {--cache=true : Use cache}';
13
14
    protected $description = 'Get single variable';
15
16
    public function handle()
17
    {
18
        $variableMng = app(\Fomvasss\Variable\VariableManagerContract::class);
0 ignored issues
show
Bug introduced by
The function app 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

18
        $variableMng = /** @scrutinizer ignore-call */ app(\Fomvasss\Variable\VariableManagerContract::class);
Loading history...
19
20
        $useCache = in_array($this->option('cache'), ['0', 'false', false]) ? false : true;
21
        $variable = $variableMng
22
//            ->setLang($this->option('langcode'))
23
//            ->setIsUseCache($this->option('cache'))
24
            ->get($this->argument('key'), null, $this->option('langcode'), $useCache);
25
26
        print_r($variable . "\n");
27
    }
28
}
29