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 ( 7cb941...28b23d )
by Stan
06:11
created

Response::execute()   C

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 1
Ratio 11.11 %

Importance

Changes 0
Metric Value
dl 1
loc 9
rs 6.2142
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Teebot\Command\Emulator;
6
7
use Symfony\Component\Console\Input\{
8
    InputArgument,
9
    InputInterface
10
};
11
use Symfony\Component\Console\Output\OutputInterface;
12
use Teebot\{
13
    Client,
14
    Command\AbstractCommand
15
};
16
17 View Code Duplication
class Response extends AbstractCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * Configures the command
21
     */
22
    public function configure()
23
    {
24
        $this
25
            ->setName('emulator:response')
26
            ->setDescription('Triggers Webhook with provided JSON string')
27
            ->setHelp('Triggers Webhook with provided JSON string')
28
            ->addArgument(
29
                'path',
30
                InputArgument::REQUIRED,
31
                'Path to bot directory'
32
            )
33
            ->addArgument(
34
                'json',
35
                InputArgument::REQUIRED,
36
                'Json string'
37
            );
38
    }
39
40
    /**
41
     * Executes the command
42
     *
43
     * @param InputInterface  $input
44
     * @param OutputInterface $output
45
     */
46
    protected function execute(InputInterface $input, OutputInterface $output)
47
    {
48
        parent::execute($input, $output);
49
50
        $client = new Client($this->config);
51
        $json   = $input->getArgument('json');
52
53
        $client->webhook($json);
54
    }
55
}
56