Completed
Pull Request — master (#24)
by Théo
05:40 queued 03:53
created

PsyshCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 6 1
A execute() 0 4 1
1
<?php
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 Psy\Shell;
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
    /**
26
     * @var Shell
27
     */
28
    private $shell;
29
30
    /**
31
     * @param Shell $shell
32
     */
33 12
    public function __construct(Shell $shell)
34
    {
35 12
        parent::__construct();
36
37 12
        $this->shell = $shell;
38 12
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 12
    protected function configure()
44
    {
45 8
        $this
46 12
            ->setName('psysh')
47 12
            ->setDescription('Start PsySH for Symfony');
48 12
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 3
    protected function execute(InputInterface $input, OutputInterface $output)
54
    {
55 3
        $this->shell->run();
56 3
    }
57
}
58