UndoCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 14 1
A getBehaviourFlags() 0 7 1
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerPatches\Composer\Commands;
7
8
use Symfony\Component\Console\Input\InputInterface;
9
10
class UndoCommand extends \Vaimo\ComposerPatches\Composer\Commands\PatchCommand
11
{
12
    protected function configure()
13
    {
14
        parent::configure();
15
16
        $this->setName('patch:undo');
17
18
        $this->setDescription('Roll back a patch or patches for certain package(s)');
19
20
        $definition = $this->getDefinition();
21
        $options = $definition->getOptions();
22
23
        unset($options['redo'], $options['undo']);
24
25
        $definition->setOptions($options);
26
    }
27
28
    protected function getBehaviourFlags(InputInterface $input)
29
    {
30
        $flags = parent::getBehaviourFlags($input);
31
32
        return array_replace(
33
            $flags,
34
            array('undo' => true)
35
        );
36
    }
37
}
38