ChangeUrlCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
cbo 4
dl 0
loc 26
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A doExecuteCommand() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the XabbuhPandaBundle package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Xabbuh\PandaBundle\Command;
13
14
use Symfony\Component\Console\Input\InputArgument;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
use Xabbuh\PandaClient\Model\Notifications;
18
19
/**
20
 * Command for modifying the endpoint of notification requests.
21
 *
22
 * @author Christian Flothmann <[email protected]>
23
 */
24
final class ChangeUrlCommand extends CloudCommand
25
{
26
    protected static $defaultName = 'panda:notifications:change-url';
27
28
    /**
29
     * {@inheritDoc}
30
     */
31 4
    protected function configure()
32
    {
33 4
        $this->setDescription('Change the endpoint for notification requests');
34 4
        $this->addArgument('url', InputArgument::REQUIRED, 'The new url', null);
35
36 4
        parent::configure();
37 4
    }
38
39
    /**
40
     * {@inheritDoc}
41
     */
42 2
    protected function doExecuteCommand(InputInterface $input, OutputInterface $output)
43
    {
44 2
        $notifications = new Notifications();
45 2
        $notifications->setUrl($input->getArgument('url'));
46 2
        $cloud = $this->getCloud($input);
47 2
        $cloud->setNotifications($notifications);
48 1
    }
49
}
50