ActiveCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A action() 0 5 1
1
<?php
2
3
namespace Terox\SubscriptionBundle\Command;
4
5
use Terox\SubscriptionBundle\Model\SubscriptionInterface;
6
use Terox\SubscriptionBundle\TeroxSubscriptionBundle;
7
8
class ActiveCommand 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.':active')
19 1
            ->setDescription('Active a subscription a expired/disabled subscription');
20 1
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    protected function action(SubscriptionInterface $subscription)
26
    {
27 1
        $this->getManager()->activate($subscription, false);
28
29 1
        $this->output->writeln(sprintf('Activated subscription'));
30 1
    }
31
}
32