Completed
Push — master ( 95a6e8...b8af6d )
by Filipe
07:12
created

Alias::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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
 * Alias definition
16
 *
17
 * @package Slick\Di\Definition
18
 * @author  Filipe Silva <[email protected]>
19
 *
20
 * @property string $target The entry name this definition points to
21
 *
22
 * @method $this|Alias setTarget(string $entryName) Sets the entry name this
23
 *                                                  definition will point to.
24
 * @method string getTarget() Gets the entry name that will resolve
25
 *                            this definition.
26
 */
27
class Alias extends AbstractDefinition implements DefinitionInterface
28
{
29
30
    /**
31
     * @readwrite
32
     * @var string
33
     */
34
    protected $target;
35
36
    /**
37
     * Resolves current definition and returns its value
38
     *
39
     * @return mixed
40
     */
41 2
    public function resolve()
42
    {
43 2
        return $this->container->get($this->target);
44
    }
45
}
46