Completed
Push — 1.x ( c183a4...05b51a )
by Alexander
8s
created

TraitIntroductionInfo   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 49
ccs 0
cts 13
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getInterfaces() 0 4 1
A getTraits() 0 4 1
1
<?php
2
/*
3
 * Go! AOP framework
4
 *
5
 * @copyright Copyright 2013, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Go\Aop\Framework;
12
13
use Go\Aop\IntroductionInfo;
14
15
/**
16
 * Advice for introduction that holds list of traits and interfaces for the concrete class
17
 */
18
class TraitIntroductionInfo implements IntroductionInfo
19
{
20
21
    /**
22
     * List of interfaces to introduce
23
     *
24
     * @var array
25
     */
26
    private $introducedInterfaces;
27
28
    /**
29
     * List of traits to include
30
     *
31
     * @var array
32
     */
33
    private $introducedTraits;
34
35
    /**
36
     * Create a DefaultIntroductionAdvisor for the given advice.
37
     *
38
     * @param string|string[] $introducedInterfaces List of introduced interfaces
39
     * @param string|string[] $introducedTraits List of introduced traits
40
     */
41
    public function __construct($introducedInterfaces, $introducedTraits)
42
    {
43
        $this->introducedInterfaces = (array) $introducedInterfaces;
44
        $this->introducedTraits     = (array) $introducedTraits;
45
    }
46
47
    /**
48
     * Return the additional interfaces introduced by this Advisor or Advice.
49
     *
50
     * @return array|string[] introduced interfaces
51
     */
52
    public function getInterfaces()
53
    {
54
        return $this->introducedInterfaces;
55
    }
56
57
    /**
58
     * Return the list of traits with realization of introduced interfaces
59
     *
60
     * @return array|string[] trait implementations
61
     */
62
    public function getTraits()
63
    {
64
        return $this->introducedTraits;
65
    }
66
}
67