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 | * Function matcher constructor |
||
43 | * |
||
44 | * @param string $functionName Name of the function to match or glob pattern |
||
45 | */ |
||
46 | public function __construct($functionName) |
||
54 | 3 | ||
55 | /** |
||
56 | * Performs matching of point of code |
||
57 | * |
||
58 | * @param mixed $function Specific part of code, can be any Reflection class |
||
59 | * @param mixed $context Related context, can be class or namespace |
||
60 | * @param null|string|object $instance Invocation instance or string for static calls |
||
61 | * @param null|array $arguments Dynamic arguments for method |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function matches($function, $context = null, $instance = null, array $arguments = null) |
||
73 | |||
74 | /** |
||
75 | * Returns the kind of point filter |
||
76 | * |
||
77 | * @return integer |
||
78 | */ |
||
79 | public function getKind() |
||
83 | |||
84 | /** |
||
85 | * Return the class filter for this pointcut. |
||
86 | * |
||
87 | * @return PointFilter |
||
88 | */ |
||
89 | public function getClassFilter() |
||
93 | |||
94 | public function setNamespaceFilter($nsFilter) |
||
98 | } |
||
99 |