1 | <?php |
||
20 | class FunctionPointcut implements Pointcut |
||
21 | { |
||
22 | /** |
||
23 | * @var PointFilter |
||
24 | */ |
||
25 | protected $nsFilter; |
||
26 | |||
27 | /** |
||
28 | * Function name to match, can contain wildcards *,? |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $functionName = ''; |
||
33 | |||
34 | /** |
||
35 | * Regular expression for matching |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $regexp; |
||
40 | |||
41 | /** |
||
42 | * Additional return type filter (if present) |
||
43 | * |
||
44 | * @var PointFilter|null |
||
45 | */ |
||
46 | protected $returnTypeFilter; |
||
47 | |||
48 | /** |
||
49 | * Function matcher constructor |
||
50 | * |
||
51 | * @param string $functionName Name of the function to match or glob pattern |
||
52 | * @param PointFilter|null $returnTypeFilter Additional return type filter |
||
53 | */ |
||
54 | 4 | public function __construct($functionName, PointFilter $returnTypeFilter = null) |
|
63 | |||
64 | /** |
||
65 | * Performs matching of point of code |
||
66 | * |
||
67 | * @param mixed $function Specific part of code, can be any Reflection class |
||
68 | * @param mixed $context Related context, can be class or namespace |
||
69 | * @param null|string|object $instance Invocation instance or string for static calls |
||
70 | * @param null|array $arguments Dynamic arguments for method |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function matches($function, $context = null, $instance = null, array $arguments = null) |
||
86 | |||
87 | /** |
||
88 | * Returns the kind of point filter |
||
89 | * |
||
90 | * @return integer |
||
91 | */ |
||
92 | public function getKind() |
||
96 | |||
97 | /** |
||
98 | * Return the class filter for this pointcut. |
||
99 | * |
||
100 | * @return PointFilter |
||
101 | */ |
||
102 | public function getClassFilter() |
||
106 | |||
107 | 4 | public function setNamespaceFilter($nsFilter) |
|
111 | } |
||
112 |