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

PingAltapayCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 6 1
A execute() 0 5 1
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