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

ProfileInfoCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 4

Test Coverage

Coverage 40.74%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
cbo 4
dl 0
loc 41
ccs 11
cts 27
cp 0.4074
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 12 1
A doExecuteCommand() 0 19 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\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