Skip to content

Commit

Permalink
#7 fix the same issue for method pointcut
Browse files Browse the repository at this point in the history
  • Loading branch information
lisachenko committed Dec 4, 2012
1 parent 4a34593 commit 022a12e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Go/Aop/Support/SignatureMethodPointcut.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ class SignatureMethodPointcut extends StaticMethodMatcherPointcut
*/
protected $modifier;

/**
* Bit mask:
*
* const IS_STATIC = 1
* const IS_ABSTRACT = 2
* const IS_FINAL = 4
* const IS_PUBLIC = 256
* const IS_PROTECTED = 512
* const IS_PRIVATE = 1024
*
* @var integer|null
*/
protected static $bitMask = 0x0701; // STATIC + PUBLIC + PROTECTED + PRIVATE


/**
* Signature method matcher constructor
*
Expand Down Expand Up @@ -61,7 +76,8 @@ public function matches($method)
return false;
}

if (!($method->getModifiers() & $this->modifier)) {
$modifiers = $method->getModifiers();
if (!($modifiers & $this->modifier) || ((self::$bitMask - $this->modifier) & $modifiers)) {
return false;
}

Expand Down

0 comments on commit 022a12e

Please sign in to comment.