Completed
Branch 2.x (dc1b30)
by Akihito
02:25
created

AspectBind   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A inject() 0 11 3
1
<?php
2
/**
3
 * This file is part of the Ray.Di package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Ray\Di;
8
9
use Ray\Aop\Bind as AopBind;
10
11
final class AspectBind
12
{
13
    /**
14
     * @var AopBind
15
     */
16
    private $bind;
17
18 7
    public function __construct(AopBind $bind)
19
    {
20 7
        $this->bind = $bind;
21 7
    }
22
23
    /**
24
     * @param Container $container
25
     *
26
     * @return array
27
     */
28 8
    public function inject(Container $container)
29
    {
30 8
        $bindings = $this->bind->getBindings();
31 8
        foreach ($bindings as &$interceptors) {
32 8
            foreach ($interceptors as &$interceptor) {
33 8
                $interceptor = $container->getInstance($interceptor, Name::ANY);
34 8
            }
35 8
        }
36
37 8
        return $bindings;
38
    }
39
}
40