Completed
Pull Request — master (#104)
by Asao
02:39
created

ConcreteDefinition   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 57
ccs 6
cts 10
cp 0.6
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A build() 0 4 1
A withArgument() 0 4 1
A withArguments() 0 4 1
1
<?php
2
3
namespace League\Container\Definition;
4
5
class ConcreteDefinition implements DefinitionInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    private $alias;
11
12
    /**
13
     * @var mixed
14
     */
15
    private $concrete;
16
17
    /**
18
     * Constructor.
19
     *
20
     * @param string $alias
21
     * @param mixed  $concrete
22
     */
23 12
    public function __construct($alias, & $concrete)
24
    {
25 12
        $this->alias     = $alias;
26 12
        $this->concrete  = & $concrete;
27 12
    }
28
29
    /**
30
     * Handle instantiation and manipulation of value and return.
31
     *
32
     * @param  array $args
33
     * @return mixed
34
     */
35 6
    public function & build(array $args = [])
36
    {
37 6
        return $this->concrete;
38
    }
39
40
    /**
41
     * Add an argument to be injected.
42
     *
43
     * @param  mixed $arg
44
     * @return $this
45
     */
46
    public function withArgument($arg)
47
    {
48
        return $this;
49
    }
50
51
    /**
52
     * Add multiple arguments to be injected.
53
     *
54
     * @param  array $args
55
     * @return $this
56
     */
57
    public function withArguments(array $args)
58
    {
59
        return $this;
60
    }
61
}