Composer::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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