Passed
Push — master ( 50d08e...d7dc61 )
by
unknown
02:43
created

HookListCommand::getHookService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Created by Graham Owens ([email protected])
5
 * Company: PartFire Ltd (www.partfire.co.uk)
6
 * Console: Discovery
7
 *
8
 * User:    gra
9
 * Date:    13/01/17
10
 * Time:    16:23
11
 * Project: PartFire MangoPay Bundle
12
 * File:    HookListCommand.php
13
 *
14
 **/
15
16
17
namespace PartFire\MangoPayBundle\Command;
18
19
use Fruitful\IdentityCheckBundle\Entity\IdentityCheck;
20
use Fruitful\IdentityCheckBundle\Entity\Repository\IdentityCheckFactoryRepository;
21
use Fruitful\IdentityCheckBundle\Event\IdentityCheckUpdateEvent;
22
use PartFire\CommonBundle\Services\Output\Cli\ConsoleOutput;
23
use PartFire\MangoPayBundle\Services\Hook;
24
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
25
use Symfony\Component\Console\Input\InputArgument;
26
use Symfony\Component\Console\Input\InputDefinition;
27
use Symfony\Component\Console\Input\InputInterface;
28
use Symfony\Component\Console\Input\InputOption;
29
use Symfony\Component\Console\Output\OutputInterface;
30
use Symfony\Component\EventDispatcher\EventDispatcher;
31
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
32
33
class HookListCommand extends ContainerAwareCommand
34
{
35
36
    private $output;
37
38
    protected function configure()
39
    {
40
        $this
41
            ->setName('partfire:mangopay:hook-list')
42
            ->setDescription('Shows all hooks registered in Mango')
43
            ;
44
45
    }
46
47
    protected function execute(InputInterface $input, OutputInterface $output)
48
    {
49
        $this->output = $this->getConsoleOutPutter();
50
        $this->output->setOutputer($output);
51
52
        $this->output->info("Listing all hooks with MangoPay");
53
        var_dump($this->getHookService()->list());
0 ignored issues
show
Security Debugging Code introduced by
var_dump($this->getHookService()->list()); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
54
    }
55
56
    private function showTitle($title)
57
    {
58
        $this->output->info(str_pad(" " . $title . " ", 80, "-", STR_PAD_BOTH));
59
    }
60
61
    private function getConsoleOutPutter() : ConsoleOutput
62
    {
63
        return $this->getContainer()->get('partfire_common.output_console');
64
    }
65
66
    private function getHookService() : Hook
67
    {
68
        return $this->getContainer()->get('part_fire_mango_pay.services.hook');
69
    }
70
71
}