Completed
Push — master ( f0b146...8f0e1e )
by Théo
02:31
created

ApplicationConfig::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 11
cts 11
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the webmozart/php-scoper package.
5
 *
6
 * (c) Bernhard Schussek <[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 Webmozart\PhpScoper\Console;
13
14
use Symfony\Component\Console\Output\OutputInterface;
15
use Webmozart\PhpScoper\Formatter\BasicFormatter;
16
use Webmozart\PhpScoper\Handler\AddPrefixCommandHandler;
17
18
/**
19
 * The configuration of the PHP-Scoper CLI.
20
 *
21
 * @since  1.0
22
 *
23
 * @author Bernhard Schussek <[email protected]>
24
 */
25
class ApplicationConfig
26
{
27 6
    public function configure(Application $app)
28
    {
29 6
        $app->command(
30 6
            'add-prefix prefix path*',
31 6
            function ($prefix, $path, OutputInterface $output) {
32 6
                $formatter = new BasicFormatter($output);
33 6
                $formatter->outputScopingStart();
34 6
                $handler = new AddPrefixCommandHandler();
35 6
                $handler->handle($prefix, $path, $formatter);
36 5
                $formatter->outputScopingEnd();
37 6
            }
38
        );
39 6
    }
40
}
41