CommandAdapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
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 28
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 1
    public function __construct(Command $command)
19
    {
20 1
        $this->command = $command;
21 1
    }
22
23
    /**
24
     * @return int|null
25
     */
26 1
    public function __invoke(InputInterface $input, OutputInterface $output)
27
    {
28 1
        $execute = \Closure::bind(
29 1
            function (InputInterface $input, OutputInterface $output) {
30 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...
31 1
            },
32 1
            $this->command,
33 1
            get_class($this->command)
34
        );
35
36 1
        return $execute($input, $output);
37
    }
38
}
39