private function getConstantValue() { if ($this->className === null) { $consts = get_defined_constants(); if (!array_key_exists($this->constName, $consts)) { throw yTest_Exception::noSuch("constant", $this->constName); } return $consts[$this->constName]; } else { $refl = new ReflectionClass($this->className); return $refl->getConstant($this->constName); } }
public final function backupStaticProperty($className, $propertyName) { if (!yTest_Reflection::isStaticProperty($className, $propertyName)) { throw yTest_Exception::noSuch("static property", "{$className}::{$propertyName}"); } $isPublic = yTest_Reflection::isPropertyPublic($className, $propertyName); if (!$isPublic) { $this->letMeAccess($className, $propertyName); } $change = new yTest_BackupStaticProperty($className, $propertyName, $isPublic); $this->codeChanger->enqueue($change); }