public static function readAttribute($classOrObject, $attributeName)
{
if (!is_string($attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
}
if (!preg_match('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'valid attribute name');
}
if (is_string($classOrObject)) {
if (!class_exists($classOrObject)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'class name');
}
return static::getStaticAttribute($classOrObject, $attributeName);
} elseif (is_object($classOrObject)) {
return static::getObjectAttribute($classOrObject, $attributeName);
} else {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'class name or object');
}
}