DisableCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Terox\SubscriptionBundle\Command;
4
5
use Terox\SubscriptionBundle\Model\SubscriptionInterface;
6
use Terox\SubscriptionBundle\TeroxSubscriptionBundle;
7
8
class DisableCommand extends AbstractCommand
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13 1
    protected function configure()
14
    {
15 1
        parent::configure();
16
17
        $this
18 1
            ->setName(TeroxSubscriptionBundle::COMMAND_NAMESPACE.':disable')
19 1
            ->setDescription('Disable a subscription');
20 1
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    protected function action(SubscriptionInterface $subscription)
26
    {
27 1
        $this->getManager()->disable($subscription);
28
29 1
        $this->output->writeln(sprintf('Disabled subscription'));
30 1
    }
31
}
32