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

TraitIntroductionInfo::getInterfaces()   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
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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