EnableOriginalDrupalKernelSubstitutionCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 7
c 2
b 0
f 2
dl 0
loc 28
ccs 4
cts 6
cp 0.6667
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 3 2
A configure() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the ekino Drupal Debug project.
7
 *
8
 * (c) ekino
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\Drupal\Debug\Composer\Command;
15
16
use Composer\Command\BaseCommand;
17
use Ekino\Drupal\Debug\Composer\Helper\ManageConfigurationHelper;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
class EnableOriginalDrupalKernelSubstitutionCommand extends BaseCommand
22
{
23
    /**
24
     * @var string
25
     */
26
    const NAME = 'drupal-debug:enable-original-drupal-kernel-substitution';
27
28
    /**
29
     * @var string
30
     */
31
    const ALIASES = array('drupal-debug:enable');
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    protected function configure(): void
37
    {
38
        $this
39 1
            ->setName(self::NAME)
40 1
            ->setAliases(self::ALIASES);
41 1
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    protected function execute(InputInterface $input, OutputInterface $output): ?int
47
    {
48
        return (new ManageConfigurationHelper($this->getComposer(), $this->getIO()))->toggleOriginalDrupalKernelSubstitution(true) ? 0 : 1;
49
    }
50
}
51