Completed
Push — master ( f25c4d...597858 )
by Joachim
02:43
created

PingAltapayCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Command;
4
5
use GuzzleHttp\Psr7;
6
use Loevgaard\AltaPay\Client;
7
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class PingAltapayCommand extends ContainerAwareCommand
12
{
13
    protected $client;
14
15
    public function __construct(Client $client)
16
    {
17
        $this->client = $client;
18
19
        parent::__construct();
20
    }
21
22
    protected function configure()
23
    {
24
        $this->setName('loevgaard:dandomain:altapay:ping')
25
            ->setDescription('This will test the connection to Altapay and test the login')
26
        ;
27
    }
28
29
    protected function execute(InputInterface $input, OutputInterface $output)
30
    {
31
        $response = $this->client->doRequest('get', '/merchant/API/login');
32
        $output->write(Psr7\str($response)."\n");
33
    }
34
}
35