Completed
Push — master ( 0ced1c...ae05a6 )
by Mickael
04:28
created

GearmanJobDescribeCommand::setGearmanClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
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
0 ignored issues
show
Documentation introduced by
Should the return type not be integer|null?

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.

Loading history...
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
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
63