PingAltapayCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

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\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