GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#158)
by Bernardo Vieira da
12:24
created

GearmanWorkerDescribeCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 9
cts 9
cp 1
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * Gearman Bundle for Symfony2
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
 */
13
14
namespace Mmoreram\GearmanBundle\Command;
15
16
use Symfony\Component\Console\Input\InputArgument;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
20
use Mmoreram\GearmanBundle\Command\Abstracts\AbstractGearmanCommand;
21
use Mmoreram\GearmanBundle\Service\GearmanClient;
22
use Mmoreram\GearmanBundle\Service\GearmanDescriber;
23
24
/**
25
 * Gearman Job Describe Command class
26
 *
27
 * @since 2.3.1
28
 */
29
class GearmanWorkerDescribeCommand extends AbstractGearmanCommand
30
{
31
    /**
32
     * @var GearmanClient
33
     *
34
     * Gearman client
35
     */
36
    protected $gearmanClient;
37
38
    /**
39
     * @var GearmanDescriber
40
     *
41
     * GearmanDescriber
42
     */
43
    protected $gearmanDescriber;
44
45
    /**
46
     * Set gearman client
47
     *
48
     * @param GearmanClient $gearmanClient Gearman client
49
     *
50
     * @return GearmanWorkerDescribeCommand self Object
51
     */
52 1
    public function setGearmanClient(GearmanClient $gearmanClient)
53
    {
54 1
        $this->gearmanClient = $gearmanClient;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * set Gearman describer
61
     *
62
     * @param GearmanDescriber $gearmanDescriber GearmanDescriber
63
     *
64
     * @return GearmanWorkerDescribeCommand self Object
65
     */
66 1
    public function setGearmanDescriber(GearmanDescriber $gearmanDescriber)
67
    {
68 1
        $this->gearmanDescriber = $gearmanDescriber;
69
70 1
        return $this;
71
    }
72
73
    /**
74
     * Console Command configuration
75
     */
76 1
    protected function configure()
77
    {
78 1
        parent::configure();
79
80
        $this
81 1
            ->setName('gearman:worker:describe')
82 1
            ->setDescription('Describe given worker')
83 1
            ->addArgument(
84 1
                'worker',
85 1
                InputArgument::REQUIRED,
86 1
                'worker to describe'
87
            );
88 1
    }
89
90
    /**
91
     * Executes the current command.
92
     *
93
     * @param InputInterface  $input  An InputInterface instance
94
     * @param OutputInterface $output An OutputInterface instance
95
     *
96
     * @return integer 0 if everything went fine, or an error code
97
     *
98
     * @throws \LogicException When this abstract class is not implemented
99
     */
100 1
    protected function execute(InputInterface $input, OutputInterface $output)
101
    {
102 1
        $worker = $input->getArgument('worker');
103
        $worker = $this
104 1
            ->gearmanClient
105 1
            ->getWorker($worker);
106
107
        $this
108 1
            ->gearmanDescriber
109 1
            ->describeWorker(
110 1
                $output,
111 1
                $worker
112
            );
113 1
    }
114
}
115