CloudInfoCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the XabbuhPandaBundle package.
5
 *
6
 * (c) Christian Flothmann <[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 Xabbuh\PandaBundle\Command;
13
14
use Symfony\Component\Console\Helper\Table;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * Command to display cloud details.
20
 *
21
 * @author Christian Flothmann <[email protected]>
22
 */
23
final class CloudInfoCommand extends CloudCommand
24
{
25
    protected static $defaultName = 'panda:cloud:info';
26
27
    /**
28
     * {@inheritDoc}
29
     */
30 3
    protected function configure()
31
    {
32 3
        $this->setDescription('Display details of a cloud');
33
34 3
        parent::configure();
35 3
    }
36
37
    /**
38
     * {@inheritDoc}
39
     */
40 2
    protected function doExecuteCommand(InputInterface $input, OutputInterface $output)
41
    {
42 2
        $cloud = $this->getCloud($input)->getCloud();
43 1
        $table = new Table($output);
44 1
        $table->addRows(array(
45 1
            array('id', $cloud->getId()),
46 1
            array('name', $cloud->getName()),
47 1
            array('s3 videos bucket', $cloud->getS3VideosBucket()),
48 1
            array('s3 private access', $cloud->isS3AccessPrivate() ? 'yes' : 'no'),
49 1
            array('url', $cloud->getUrl()),
50 1
            array('created at', $cloud->getCreatedAt()),
51 1
            array('updated at', $cloud->getUpdatedAt()),
52
        ));
53 1
        $table->render($output);
0 ignored issues
show
Unused Code introduced by
The call to Table::render() has too many arguments starting with $output.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
54 1
    }
55
}
56