当前位置: 首页>>代码示例>>PHP>>正文


PHP Type::getEnumName方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:101,代码来源:Serializer.class.php

示例2: remove

 public function remove($key)
 {
     return $this->_hash->remove(Type::getEnumName(Type::getEnum($key)));
 }
开发者ID:slaskis,项目名称:hxsinatra,代码行数:4,代码来源:EnumHash.class.php

示例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));
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:37,代码来源:Injector.class.php


注:本文中的Type::getEnumName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。