InlineConfigurator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A doAccept() 0 4 1
A doConfigure() 0 6 1
1
<?php
2
/**
3
 * This file is part of the phpspec-console package.
4
 * (c) 2017 Timo Michna <timomichna/yahoo.de>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Tidal\PhpSpec\ConsoleExtension\Command;
11
12
use Tidal\PhpSpec\ConsoleExtension\Behavior\Command\ConfiguratorTrait;
13
use Tidal\PhpSpec\ConsoleExtension\Contract\Command\{
14
    CommandInterface, InlineConfigCommandInterface, ConfiguratorInterface
15
};
16
17
/**
18
 * class Tidal\PhpSpec\ConsoleExtension\Command\InlineConfigurator
19
 */
20
class InlineConfigurator implements ConfiguratorInterface
21
{
22
    use ConfiguratorTrait;
23
24
     /**
25
     * @param CommandInterface $command
26
     * @return bool
27
     */
28
    protected function doAccept(CommandInterface $command): bool
29
    {
30
        return $command instanceof InlineConfigCommandInterface;
31
    }
32
33
    /**
34
     * @param InlineConfigCommandInterface $command
35
     */
36
    protected function doConfigure(InlineConfigCommandInterface $command)
37
    {
38
        $this->setConfig(
39
            $command->getConfig()
40
        );
41
    }
42
}
43
44