Test Failed
Pull Request — master (#28)
by Pádraic
02:32
created

ApplicationConfig::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 2
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
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
    public function configure(Application $app, array $declaredClasses = [])
28
    {
29
        $app->command(
30
            'add-prefix prefix path*',
31
            function ($prefix, $path, OutputInterface $output) use ($declaredClasses) {
32
                $formatter = new BasicFormatter($output);
33
                $formatter->outputScopingStart();
34
                $handler = new AddPrefixCommandHandler();
35
                $handler->handle($prefix, $path, $formatter, $declaredClasses);
0 ignored issues
show
Unused Code introduced by
The call to AddPrefixCommandHandler::handle() has too many arguments starting with $declaredClasses.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
36
                $formatter->outputScopingEnd();
37
            }
38
        );
39
    }
40
}
41