|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Go! AOP framework |
|
4
|
|
|
* |
|
5
|
|
|
* @copyright Copyright 2015, 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\Pointcut; |
|
12
|
|
|
|
|
13
|
|
|
use Go\Aop\PointFilter; |
|
14
|
|
|
use Go\Aop\Support\ModifierMatcherFilter; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Data transfer object for storing a reference to the class member (property or method) |
|
18
|
|
|
*/ |
|
19
|
|
|
class ClassMemberReference |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* Filter for class names |
|
23
|
|
|
* |
|
24
|
|
|
* @var PointFilter |
|
25
|
|
|
*/ |
|
26
|
|
|
private $classFilter; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Member visibility filter (public/protected/etc) |
|
30
|
|
|
* |
|
31
|
|
|
* @var ModifierMatcherFilter |
|
32
|
|
|
*/ |
|
33
|
|
|
private $visibilityFilter; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Filter for access type (statically "::" or dynamically "->") |
|
37
|
|
|
* |
|
38
|
|
|
* @var ModifierMatcherFilter |
|
39
|
|
|
*/ |
|
40
|
|
|
private $accessTypeFilter; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Member name pattern |
|
44
|
|
|
* |
|
45
|
|
|
* @var string |
|
46
|
|
|
*/ |
|
47
|
|
|
private $memberNamePattern; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Default constructor |
|
51
|
|
|
* |
|
52
|
|
|
* @param PointFilter $classFilter |
|
53
|
|
|
* @param ModifierMatcherFilter $visibilityFilter Public/protected/etc |
|
54
|
|
|
* @param ModifierMatcherFilter $accessTypeFilter Static or dynamic |
|
55
|
|
|
* @param string $memberNamePattern Expression for the name |
|
56
|
|
|
*/ |
|
57
|
|
|
public function __construct( |
|
58
|
|
|
PointFilter $classFilter, |
|
59
|
|
|
ModifierMatcherFilter $visibilityFilter, |
|
60
|
|
|
ModifierMatcherFilter $accessTypeFilter, |
|
61
|
|
|
$memberNamePattern) |
|
|
|
|
|
|
62
|
|
|
{ |
|
|
|
|
|
|
63
|
|
|
$this->classFilter = $classFilter; |
|
64
|
|
|
$this->visibilityFilter = $visibilityFilter; |
|
65
|
|
|
$this->accessTypeFilter = $accessTypeFilter; |
|
66
|
|
|
$this->memberNamePattern = $memberNamePattern; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @return PointFilter |
|
71
|
|
|
*/ |
|
72
|
|
|
public function getClassFilter() |
|
73
|
|
|
{ |
|
74
|
|
|
return $this->classFilter; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @return ModifierMatcherFilter |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getVisibilityFilter() |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->visibilityFilter; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @return ModifierMatcherFilter |
|
87
|
|
|
*/ |
|
88
|
|
|
public function getAccessTypeFilter() |
|
89
|
|
|
{ |
|
90
|
|
|
return $this->accessTypeFilter; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* @return string |
|
95
|
|
|
*/ |
|
96
|
|
|
public function getMemberNamePattern() |
|
97
|
|
|
{ |
|
98
|
|
|
return $this->memberNamePattern; |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|