Passed
Push — master ( 477224...3259b8 )
by Aleksei
06:12 queued 18s
created

BindMethodResolver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Boot\BootloadManager\AttributeResolver;
6
7
use Spiral\Boot\Attribute\BindMethod;
8
use Spiral\Boot\Bootloader\BootloaderInterface;
9
use Spiral\Core\Config\Factory;
10
11
/**
12
 * @internal
13
 * @extends AbstractResolver<BindMethod, BootloaderInterface>
14
 */
15
final class BindMethodResolver extends AbstractResolver
16
{
17 7
    public function resolve(object $attribute, object $service, \ReflectionMethod $method): void
18
    {
19 7
        $aliases = $this->getAliases($attribute, $method);
20 6
        $closure = new Factory(
21 6
            callable: $method->getClosure($service),
22 6
            singleton: false,
23 6
        );
24
25 6
        $this->bind($aliases, $closure, $this->getScopes($method));
26
    }
27
}
28