Completed
Push — master ( 7e3d04...dc7866 )
by Changwan
06:39
created

InstanceResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A resolve() 0 4 1
1
<?php
2
namespace Wandu\DI\Resolvers;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\Contracts\ResolverInterface;
6
7
class InstanceResolver implements ResolverInterface
8
{
9
    /** @var mixed */
10
    protected $instance;
11
12 30
    public function __construct($instance)
13
    {
14 30
        $this->instance = $instance;
15 30
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 22
    public function resolve(ContainerInterface $container, array $arguments = [])
21
    {
22 22
        return $this->instance;
23
    }
24
}
25