本文整理汇总了PHP中Type::getEnumName方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getEnumName方法的具体用法?PHP Type::getEnumName怎么用?PHP Type::getEnumName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::getEnumName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
//.........这里部分代码省略.........
$charsBuf->add(_hx_char_at($b64, $b11 >> 2));
$charsBuf->add(_hx_char_at($b64, ($b11 << 4 | $b21 >> 4) & 63));
$charsBuf->add(_hx_char_at($b64, $b21 << 2 & 63));
} else {
if ($i2 === $max + 1) {
$b12 = null;
$pos5 = $i2++;
$b12 = ord($v7->b[$pos5]);
$charsBuf->add(_hx_char_at($b64, $b12 >> 2));
$charsBuf->add(_hx_char_at($b64, $b12 << 4 & 63));
}
}
$chars = $charsBuf->b;
$this->buf->add("s");
$this->buf->add(strlen($chars));
$this->buf->add(":");
$this->buf->add($chars);
break;
default:
if ($this->useCache) {
$this->cache->pop();
}
if (_hx_field($v, "hxSerialize") !== null) {
$this->buf->add("C");
$this->serializeString(Type::getClassName($c));
if ($this->useCache) {
$this->cache->push($v);
}
$v->hxSerialize($this);
$this->buf->add("g");
} else {
$this->buf->add("c");
$this->serializeString(Type::getClassName($c));
if ($this->useCache) {
$this->cache->push($v);
}
$this->serializeFields($v);
}
break;
}
break;
case 4:
if (Std::is($v, _hx_qtype("Class"))) {
$className = Type::getClassName($v);
$this->buf->add("A");
$this->serializeString($className);
} else {
if (Std::is($v, _hx_qtype("Enum"))) {
$this->buf->add("B");
$this->serializeString(Type::getEnumName($v));
} else {
if ($this->useCache && $this->serializeRef($v)) {
return;
}
$this->buf->add("o");
$this->serializeFields($v);
}
}
break;
case 7:
$e = _hx_deref($_g)->params[0];
if ($this->useCache) {
if ($this->serializeRef($v)) {
return;
}
$this->cache->pop();
}
$this->buf->add($this->useEnumIndex ? "j" : "w");
$this->serializeString(Type::getEnumName($e));
if ($this->useEnumIndex) {
$this->buf->add(":");
$this->buf->add($v->index);
} else {
$this->serializeString($v->tag);
}
$this->buf->add(":");
$l1 = count($v->params);
if ($l1 === 0 || _hx_field($v, "params") === null) {
$this->buf->add(0);
} else {
$this->buf->add($l1);
$_g11 = 0;
while ($_g11 < $l1) {
$i3 = $_g11++;
$this->serialize($v->params[$i3]);
unset($i3);
}
}
if ($this->useCache) {
$this->cache->push($v);
}
break;
case 5:
throw new HException("Cannot serialize function");
break;
default:
throw new HException("Cannot serialize " . Std::string($v));
break;
}
}
示例2: remove
public function remove($key)
{
return $this->_hash->remove(Type::getEnumName(Type::getEnum($key)));
}
示例3: getValueType
static function getValueType($value)
{
if (Std::is($value, _hx_qtype("String"))) {
return "String";
}
if (Std::is($value, _hx_qtype("Class"))) {
return Type::getClassName($value);
}
if (Std::is($value, _hx_qtype("Enum"))) {
return Type::getEnumName($value);
}
$name = null;
$_g = Type::typeof($value);
switch ($_g->index) {
case 1:
$name = "Int";
break;
case 3:
$name = "Bool";
break;
case 6:
$c = _hx_deref($_g)->params[0];
$name = Type::getClassName($c);
break;
case 7:
$e = _hx_deref($_g)->params[0];
$name = Type::getEnumName($e);
break;
default:
$name = null;
break;
}
if ($name !== null) {
return $name;
}
throw new HException("Could not determine type name of " . Std::string($value));
}