Completed
Push — master ( 003b5e...76542b )
by Woody
38:06 queued 22:13
created

AurynResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
namespace Equip\Resolver;
3
4
use Auryn\Injector;
5
use Relay\ResolverInterface;
6
7
class AurynResolver implements ResolverInterface
8
{
9
    /**
10
     * @var Injector
11
     */
12
    private $injector;
13
14 25
    public function __construct(Injector $injector)
15
    {
16 25
        $this->injector = $injector;
17 25
    }
18
19
    /**
20
     * Get an instance of the given class
21
     *
22
     * @param string $spec Fully-qualified class name
23
     *
24
     * @return object
25
     */
26 16
    public function __invoke($spec)
27
    {
28 16
        return $this->injector->make($spec);
29
    }
30
}
31