/** * Default constructor * * @param string $leftExpression String representing the expression defining this pointcut left of the connector * @param string $rightExpression String representing the expression defining this pointcut right of the connector */ public function __construct($leftExpression, $rightExpression) { parent::__construct($leftExpression . $this->getConnector() . $rightExpression, false); $pointcutFactory = new PointcutFactory(); $this->leftPointcut = $pointcutFactory->getInstance($leftExpression); $this->rightPointcut = $pointcutFactory->getInstance($rightExpression); }
/** * Default constructor * * @param string $expression String representing the expression defining this pointcut * @param boolean $isNegated If any match made against this pointcut's expression has to be negated in its result */ public function __construct($expression, $isNegated) { parent::__construct($expression, $isNegated); // filter what we need if (strpos($expression, self::CALL_TYPE_OBJECT) !== false || strpos($expression, self::CALL_TYPE_STATIC) !== false) { // assume an object call but correct the call type in the unlikely case we did get a static call $this->callType = self::CALL_TYPE_OBJECT; if (strpos($expression, self::CALL_TYPE_STATIC) !== false) { $this->callType = self::CALL_TYPE_STATIC; } // we have to isolate the parts of the expression $this->structure = strstr($expression, $this->callType, true); $this->function = str_replace($this->structure . $this->callType, '', $expression); } else { $this->callType = null; $this->structure = null; $this->function = null; } }