1 | <?php |
||
36 | abstract class AbstractSignaturePointcut extends AbstractPointcut |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Call type for a call from an object |
||
41 | * |
||
42 | * @var string CALL_TYPE_OBJECT |
||
43 | */ |
||
44 | const CALL_TYPE_OBJECT = '->'; |
||
45 | |||
46 | /** |
||
47 | * Call type for a static call |
||
48 | * |
||
49 | * @var string CALL_TYPE_STATIC |
||
50 | */ |
||
51 | const CALL_TYPE_STATIC = '::'; |
||
52 | |||
53 | /** |
||
54 | * The pattern used by this pointcut to match candidates |
||
55 | * |
||
56 | * @var string MATCH_PATTERN |
||
57 | */ |
||
58 | const MATCH_PATTERN = PointcutPatterns::SIGNATURE; |
||
59 | |||
60 | /** |
||
61 | * The type of the call made to $function |
||
62 | * |
||
63 | * @var string|null $callType |
||
64 | * |
||
65 | * @Enum({"->", "::", null}) |
||
66 | */ |
||
67 | protected $callType; |
||
68 | |||
69 | /** |
||
70 | * Function/method which will get called within the signature expression |
||
71 | * |
||
72 | * @var string $function |
||
73 | */ |
||
74 | protected $function; |
||
75 | |||
76 | /** |
||
77 | * Structure name (if any) of the structure the called method belongs to |
||
78 | * |
||
79 | * @var string|null $structure |
||
80 | */ |
||
81 | protected $structure; |
||
82 | |||
83 | /** |
||
84 | * Default constructor |
||
85 | * |
||
86 | * @param string $expression String representing the expression defining this pointcut |
||
87 | * @param boolean $isNegated If any match made against this pointcut's expression has to be negated in its result |
||
88 | */ |
||
89 | public function __construct($expression, $isNegated) |
||
111 | |||
112 | /** |
||
113 | * Will return a chain of callbacks which can be used to call woven code in an onion like manner |
||
114 | * |
||
115 | * @param \AppserverIo\Doppelgaenger\Entities\Definitions\FunctionDefinition $functionDefinition Definition of the function to inject invocation code into |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | public function getCallbackChain(FunctionDefinition $functionDefinition) |
||
138 | |||
139 | /** |
||
140 | * Used to "straighten out" an expression as some expressions allow for shell regex which makes them hard to |
||
141 | * generate code from. |
||
142 | * So with this method a matching pointcut can be altered into having a directly readable expression |
||
143 | * |
||
144 | * @param FunctionDefinition|AttributeDefinition $definition Definition to straighten the expression against |
||
145 | * |
||
146 | * @return null |
||
147 | */ |
||
148 | public function straightenExpression($definition) |
||
164 | } |
||
165 |