Composer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
A getOptions() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Console\Console\Commands;
6
7
use Illuminate\Console\Command;
8
use Symfony\Component\Console\Input\InputOption;
9
use Symfony\Component\Console\Input\StringInput;
10
11
class Composer extends Command
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'composer';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'composer';
26
27
    /**
28
     * handle.
29
     */
30
    public function handle()
31
    {
32
        $input = new StringInput(trim($this->option('command')));
33
        $output = $this->getOutput();
34
35
        $application = new \Composer\Console\Application();
36
        $application->setAutoExit(false);
37
        $application->run($input, $output);
38
    }
39
40
    /**
41
     * Get the console command options.
42
     *
43
     * @return array
44
     */
45
    protected function getOptions(): array
46
    {
47
        return [
48
            ['command', null, InputOption::VALUE_OPTIONAL],
49
        ];
50
    }
51
}
52