本文整理汇总了PHP中Type::getEnumConstructs方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getEnumConstructs方法的具体用法?PHP Type::getEnumConstructs怎么用?PHP Type::getEnumConstructs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::getEnumConstructs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createEnumIndex
static function createEnumIndex($e, $index, $params)
{
$c = _hx_array_get(Type::getEnumConstructs($e), $index);
if ($c === null) {
throw new HException($index . " is not a valid enum constructor index");
}
return Type::createEnum($e, $c, $params);
}
示例2: unserialize
//.........这里部分代码省略.........
break;
case 120:
throw new HException($this->unserialize());
break;
case 99:
$name = $this->unserialize();
$cl = $this->resolver->resolveClass($name);
if ($cl === null) {
throw new HException("Class not found " . _hx_string_or_null($name));
}
$o1 = Type::createEmptyInstance($cl);
$this->cache->push($o1);
$this->unserializeObject($o1);
return $o1;
break;
case 119:
$name1 = $this->unserialize();
$edecl = $this->resolver->resolveEnum($name1);
if ($edecl === null) {
throw new HException("Enum not found " . _hx_string_or_null($name1));
}
$e = $this->unserializeEnum($edecl, $this->unserialize());
$this->cache->push($e);
return $e;
break;
case 106:
$name2 = $this->unserialize();
$edecl1 = $this->resolver->resolveEnum($name2);
if ($edecl1 === null) {
throw new HException("Enum not found " . _hx_string_or_null($name2));
}
$this->pos++;
$index = $this->readDigits();
$tag = _hx_array_get(Type::getEnumConstructs($edecl1), $index);
if ($tag === null) {
throw new HException("Unknown enum index " . _hx_string_or_null($name2) . "@" . _hx_string_rec($index, ""));
}
$e1 = $this->unserializeEnum($edecl1, $tag);
$this->cache->push($e1);
return $e1;
break;
case 108:
$l = new HList();
$this->cache->push($l);
$buf1 = $this->buf;
while (ord(substr($this->buf, $this->pos, 1)) !== 104) {
$l->add($this->unserialize());
}
$this->pos++;
return $l;
break;
case 98:
$h = new haxe_ds_StringMap();
$this->cache->push($h);
$buf2 = $this->buf;
while (ord(substr($this->buf, $this->pos, 1)) !== 104) {
$s1 = $this->unserialize();
$h->set($s1, $this->unserialize());
unset($s1);
}
$this->pos++;
return $h;
break;
case 113:
$h1 = new haxe_ds_IntMap();
$this->cache->push($h1);
示例3: allEnums
static function allEnums($e)
{
$all = new _hx_array(array());
$_g = 0;
$_g1 = Type::getEnumConstructs($e);
while ($_g < $_g1->length) {
$c = $_g1[$_g];
++$_g;
$v = Reflect::field($e, $c);
if (!Reflect::isFunction($v)) {
$all->push($v);
}
unset($v, $c);
}
return $all;
}