Completed
Push — develop ( f0edc8...54f05a )
by Filipe
22s queued 20s
created

Value   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 26
ccs 2
cts 2
cp 1
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of slick/di package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Di\Definition;
11
12
use Slick\Di\DefinitionInterface;
13
14
/**
15
 * Value definition
16
 *
17
 * @package Slick\Di\Definition
18
 * @author  Filipe Silva <[email protected]>
19
 */
20
class Value extends AbstractDefinition implements DefinitionInterface
21
{
22
23
    /**
24
     * @var mixed
25
     */
26
    protected $data;
27
28
    /**
29
     * Value definition
30
     *
31
     * @param mixed $data
32
     */
33
    public function __construct($data)
34
    {
35
        $this->data = $data;
36
    }
37 6
38
    /**
39 6
     * Resolves the definition into a scalar or object
40
     *
41
     * @return mixed
42
     */
43
    public function resolve()
44
    {
45
        return $this->data;
46
    }
47
}
48