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

PsyshCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 4
Bugs 1 Features 1
Metric Value
c 4
b 1
f 1
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 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