/** * Constructor for field access * * @param string $className Class name * @param string $fieldName Field name * @param $advices array List of advices for this invocation */ public function __construct($className, $fieldName, array $advices) { parent::__construct($advices); $this->reflectionProperty = $reflectionProperty = new ReflectionProperty($className, $fieldName); // Give an access to protected field if ($reflectionProperty->isProtected()) { $reflectionProperty->setAccessible(true); } }
/** * Constructor for static initialization joinpoint * * @param string $className Name of the class * @param string $type Type of joinpoint * @param $advices array List of advices for this invocation * * @internal param ReflectionClass $reflectionClass Reflection of class */ public function __construct($className, $type, array $advices) { if (strpos($className, AspectContainer::AOP_PROXIED_SUFFIX)) { $originalClass = substr($className, 0, -strlen(AspectContainer::AOP_PROXIED_SUFFIX)); } else { $originalClass = $className; } $this->reflectionClass = new \ReflectionClass($originalClass); parent::__construct($advices); }