Completed
Push — master ( 98e9d1...4a142c )
by Christian
02:31
created

ProfileInfoCommand::doExecuteCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.7024
Metric Value
dl 0
loc 19
ccs 2
cts 18
cp 0.1111
rs 9.4286
cc 1
eloc 16
nc 1
nop 2
crap 1.7024
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\Input\InputArgument;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * Show a profile's details.
20
 *
21
 * @author Christian Flothmann <[email protected]>
22
 */
23
class ProfileInfoCommand extends CloudCommand
24
{
25
    /**
26
     * {@inheritDoc}
27
     */
28 3
    protected function configure()
29
    {
30 3
        $this->setName('panda:profile:info');
31 3
        $this->setDescription('Fetch information for a profile');
32 3
        $this->addArgument(
33 3
            'profile-id',
34 3
            InputArgument::REQUIRED,
35
            'The id of the profile being fetched'
36 3
        );
37
38 3
        parent::configure();
39 3
    }
40
41
    /**
42
     * {@inheritDoc}
43
     */
44 1
    protected function doExecuteCommand(InputInterface $input, OutputInterface $output)
45
    {
46 1
        $profile = $this->getCloud($input)->getProfile($input->getArgument('profile-id'));
47
        $table = $this->getTableHelper($output);
48
        $table->addRows(array(
49
            array('id', $profile->getId()),
50
            array('title', $profile->getTitle()),
51
            array('name', $profile->getName()),
52
            array('file extension', $profile->getExtname()),
53
            array('width', $profile->getWidth()),
54
            array('height', $profile->getHeight()),
55
            array('audio bit rate', $profile->getAudioBitrate()),
56
            array('video bit rate', $profile->getVideoBitrate()),
57
            array('aspect mode', $profile->getAspectMode()),
58
            array('created at', $profile->getCreatedAt()),
59
            array('updated at', $profile->getUpdatedAt()),
60
        ));
61
        $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...
62
    }
63
}
64