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

ApplicationConfig   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 16
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 13 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