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
Push — master ( e2875b...35ced9 )
by Anton
03:41
created

ConnectCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Console;
9
10
use Deployer\Deployer;
11
use Deployer\Executor\Worker;
12
use Symfony\Component\Console\Command\Command;
13
use Symfony\Component\Console\Input\InputArgument;
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Input\InputOption as Option;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
class ConnectCommand extends Command
19
{
20
    protected $deployer;
21
22 12
    public function __construct(Deployer $deployer)
23
    {
24 12
        parent::__construct('connect');
25 12
        $this->deployer = $deployer;
26 12
        $this->setHidden(true);
27 12
    }
28
29 12
    protected function configure()
30
    {
31 12
        $this->addArgument('connect-host', InputArgument::REQUIRED);
32 12
        $this->addOption('decorated', null, Option::VALUE_NONE);
33 12
    }
34
35
    protected function execute(InputInterface $input, OutputInterface $output)
36
    {
37
        $this->deployer->input = $input;
38
        $this->deployer->output = $output;
39
        $output->setDecorated($input->getOption('decorated'));
40
        if (!$output->isDecorated() && !defined('NO_ANSI')) {
41
            define('NO_ANSI', 'true');
42
        }
43
        $host = $this->deployer->hosts->get($input->getArgument('connect-host'));
44
        $this->deployer->sshClient->connect($host);
45
        return 0;
46
    }
47
}
48