1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Gearman Bundle for Symfony2 / Symfony3 |
5
|
|
|
* |
6
|
|
|
* For the full copyright and license information, please view the LICENSE |
7
|
|
|
* file that was distributed with this source code. |
8
|
|
|
* |
9
|
|
|
* Feel free to edit as you please, and have fun. |
10
|
|
|
* |
11
|
|
|
* @author Marc Morera <[email protected]> |
12
|
|
|
* @author Mickael Perraud <[email protected]> |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace Mkk\GearmanBundle\Command; |
16
|
|
|
|
17
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
18
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
19
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
20
|
|
|
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Gearman Job Describe Command class |
24
|
|
|
*/ |
25
|
|
|
class GearmanJobDescribeCommand extends ContainerAwareCommand |
26
|
|
|
{ |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Console Command configuration |
30
|
|
|
*/ |
31
|
16 |
|
protected function configure() |
32
|
|
|
{ |
33
|
|
|
$this |
34
|
16 |
|
->setName('gearman:job:describe') |
35
|
16 |
|
->setDescription('Describe given job') |
36
|
16 |
|
->addArgument( |
37
|
16 |
|
'job', |
38
|
16 |
|
InputArgument::REQUIRED, |
39
|
16 |
|
'job to describe' |
40
|
|
|
); |
41
|
16 |
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Executes the current command. |
45
|
|
|
* |
46
|
|
|
* @param InputInterface $input An InputInterface instance |
47
|
|
|
* @param OutputInterface $output An OutputInterface instance |
48
|
|
|
* |
49
|
|
|
* @return integer 0 if everything went fine, or an error code |
|
|
|
|
50
|
|
|
* |
51
|
|
|
* @throws \LogicException When this abstract class is not implemented |
52
|
|
|
*/ |
53
|
1 |
|
protected function execute(InputInterface $input, OutputInterface $output) |
54
|
|
|
{ |
55
|
1 |
|
$job = $input->getArgument('job'); |
56
|
1 |
|
$job = $this->getContainer()->get('gearman')->getJob($job); |
57
|
|
|
|
58
|
|
|
$this |
59
|
1 |
|
->getContainer()->get('gearman.describer') |
60
|
1 |
|
->describeJob($output, $job); |
61
|
1 |
|
} |
62
|
|
|
} |
|
|
|
|
63
|
|
|
|
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.