Completed
Push — master ( f22ae4...0f9bab )
by Alexander
01:55
created

TraitIntroductionInfo::getTrait()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types = 1);
3
/*
4
 * Go! AOP framework
5
 *
6
 * @copyright Copyright 2013, Lisachenko Alexander <[email protected]>
7
 *
8
 * This source file is subject to the license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Go\Aop\Framework;
13
14
use Go\Aop\IntroductionInfo;
15
16
/**
17
 * Advice for introduction that holds list of traits and interfaces for the concrete class
18
 */
19
class TraitIntroductionInfo implements IntroductionInfo
20
{
21
    /**
22
     * Introduced interface
23
     *
24
     * @var string
25
     */
26
    private $introducedInterface;
27
28
    /**
29
     * Trait to use
30
     *
31
     * @var string
32
     */
33
    private $introducedTrait;
34
35
    /**
36
     * Create a DefaultIntroductionAdvisor for the given advice.
37
     *
38
     * @param string $introducedTrait Introduced trait
39
     * @param string $introducedInterface Introduced interface
40
     */
41
    public function __construct(string $introducedTrait, string $introducedInterface)
42
    {
43
        $this->introducedTrait     = $introducedTrait;
44
        $this->introducedInterface = $introducedInterface;
45
    }
46
47
    /**
48
     * Returns the additional interface introduced by this Advisor or Advice.
49
     */
50
    public function getInterface(): string
51
    {
52
        return $this->introducedInterface;
53
    }
54
55
    /**
56
     * Returns the additional trait with realization of introduced interface
57
     */
58
    public function getTrait(): string
59
    {
60
        return $this->introducedTrait;
61
    }
62
}
63