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\InputArgument; |
16
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
17
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Show a profile's details. |
21
|
|
|
* |
22
|
|
|
* @author Christian Flothmann <[email protected]> |
23
|
|
|
*/ |
24
|
|
|
final class ProfileInfoCommand extends CloudCommand |
25
|
|
|
{ |
26
|
|
|
protected static $defaultName = 'panda:profile:info'; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* {@inheritDoc} |
30
|
|
|
*/ |
31
|
4 |
|
protected function configure() |
32
|
|
|
{ |
33
|
4 |
|
$this->setDescription('Fetch information for a profile'); |
34
|
4 |
|
$this->addArgument( |
35
|
4 |
|
'profile-id', |
36
|
4 |
|
InputArgument::REQUIRED, |
37
|
4 |
|
'The id of the profile being fetched' |
38
|
|
|
); |
39
|
|
|
|
40
|
4 |
|
parent::configure(); |
41
|
4 |
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* {@inheritDoc} |
45
|
|
|
*/ |
46
|
2 |
|
protected function doExecuteCommand(InputInterface $input, OutputInterface $output) |
47
|
|
|
{ |
48
|
2 |
|
$profile = $this->getCloud($input)->getProfile($input->getArgument('profile-id')); |
|
|
|
|
49
|
1 |
|
$table = new Table($output); |
50
|
1 |
|
$table->addRows(array( |
51
|
1 |
|
array('id', $profile->getId()), |
52
|
1 |
|
array('title', $profile->getTitle()), |
53
|
1 |
|
array('name', $profile->getName()), |
54
|
1 |
|
array('file extension', $profile->getExtname()), |
55
|
1 |
|
array('width', $profile->getWidth()), |
56
|
1 |
|
array('height', $profile->getHeight()), |
57
|
1 |
|
array('audio bit rate', $profile->getAudioBitrate()), |
58
|
1 |
|
array('video bit rate', $profile->getVideoBitrate()), |
59
|
1 |
|
array('aspect mode', $profile->getAspectMode()), |
60
|
1 |
|
array('created at', $profile->getCreatedAt()), |
61
|
1 |
|
array('updated at', $profile->getUpdatedAt()), |
62
|
|
|
)); |
63
|
1 |
|
$table->render($output); |
|
|
|
|
64
|
1 |
|
} |
65
|
|
|
} |
66
|
|
|
|
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.