PsyshCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2
ccs 5
cts 5
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 4 1
A execute() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the PsyshBundle package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\PsyshBundle\Command;
13
14
use Symfony\Component\Console\Application;
15
use Symfony\Component\Console\Command\Command;
16
use Symfony\Component\Console\Input\InputInterface;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
/**
20
 * @author Adrian PALMER <[email protected]>
21
 * @author Théo FIDRY    <[email protected]>
22
 */
23
final class PsyshCommand extends Command
24
{
25
    private $psysh;
26
27
    public function __construct(Application $psysh)
28
    {
29
        parent::__construct();
30
31
        $this->psysh = $psysh;
32
    }
33 12
34
    protected function configure(): void
35 12
    {
36
        $this->setDescription('Start PsySH for Symfony');
37 12
    }
38 12
39
    protected function execute(InputInterface $input, OutputInterface $output): int
40
    {
41
        return (int) $this->psysh->run($input, $output);
42
    }
43
}
44