Completed
Push — master ( 70ad44...4c5fb5 )
by Dominik
06:07 queued 04:07
created

CommandAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 12 1
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 1
    public function __construct(Command $command)
22
    {
23 1
        $this->command = $command;
24 1
    }
25
26
    /**
27
     * @param InputInterface  $input
28
     * @param OutputInterface $output
29
     *
30
     * @return int|null
31
     */
32 1
    public function __invoke(InputInterface $input, OutputInterface $output)
33
    {
34 1
        $execute = \Closure::bind(
35 1
            function (InputInterface $input, OutputInterface $output) {
36 1
                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 1
            },
38 1
            $this->command,
39 1
            get_class($this->command)
40
        );
41
42 1
        return $execute($input, $output);
43
    }
44
}
45