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

TraitIntroductionInfo   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 44
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getInterface() 0 4 1
A getTrait() 0 4 1
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