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

InstanceResolver::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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