Test Failed
Push — master ( 657bea...70ad44 )
by Dominik
05:32
created

CommandAdapter::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Lazy;
6
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
final class CommandAdapter
12
{
13
    /**
14
     * @var Command
15
     */
16
    private $command;
17
18
    /**
19
     * @param Command $command
20
     */
21
    public function __construct(Command $command)
22
    {
23
        $this->command = $command;
24
    }
25
26
    /**
27
     * @param InputInterface  $input
28
     * @param OutputInterface $output
29
     *
30
     * @return int|null
31
     */
32
    public function __invoke(InputInterface $input, OutputInterface $output): ?int
33
    {
34
        $execute = \Closure::bind(
35
            function (InputInterface $input, OutputInterface $output) {
36
                return $this->execute($input, $output);
0 ignored issues
show
Bug introduced by
The method execute() does not seem to exist on object<Chubbyphp\Lazy\CommandAdapter>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
            },
38
            $this->command,
39
            get_class($this->command)
40
        );
41
42
        return $execute($input, $output);
43
    }
44
}
45