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


PHP Shape::create方法代码示例

本文整理汇总了PHP中Shape::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Shape::create方法的具体用法?PHP Shape::create怎么用?PHP Shape::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shape的用法示例。


在下文中一共展示了Shape::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getKey

 /**
  * @return Shape
  */
 public function getKey()
 {
     if (!$this->key) {
         $this->key = isset($this->definition['key']) ? Shape::create($this->definition['key'], $this->shapeMap) : new Shape(['type' => 'string'], $this->shapeMap);
     }
     return $this->key;
 }
开发者ID:abdala,项目名称:generic-api-client,代码行数:10,代码来源:MapShape.php

示例2: getMember

 /**
  * @return Shape
  *
  * @throws \RuntimeException if no member is specified
  */
 public function getMember()
 {
     if (!$this->member) {
         if (!isset($this->definition['member'])) {
             throw new \RuntimeException('No member attribute specified');
         }
         $this->member = Shape::create($this->definition['member'], $this->shapeMap);
     }
     return $this->member;
 }
开发者ID:ossistyle,项目名称:http-client-description,代码行数:15,代码来源:ListShape.php

示例3: resolve

 /**
  * Resolve a shape reference
  *
  * @param array $shapeRef Shape reference shape
  *
  * @return Shape
  * @throws \InvalidArgumentException
  */
 public function resolve(array $shapeRef)
 {
     $shape = $shapeRef['shape'];
     if (!isset($this->definitions[$shape])) {
         throw new \InvalidArgumentException('Shape not found: ' . $shape);
     }
     $isSimple = count($shapeRef) == 1;
     if ($isSimple && isset($this->simple[$shape])) {
         return $this->simple[$shape];
     }
     $definition = $shapeRef + $this->definitions[$shape];
     $definition['name'] = $definition['shape'];
     unset($definition['shape']);
     $result = Shape::create($definition, $this);
     if ($isSimple) {
         $this->simple[$shape] = $result;
     }
     return $result;
 }
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:27,代码来源:ShapeMap.php

示例4: shapeFor

 protected function shapeFor(array $definition)
 {
     return isset($definition['shape']) ? $this->shapeMap->resolve($definition) : Shape::create($definition, $this->shapeMap);
 }
开发者ID:xgin,项目名称:aws-sdk-php,代码行数:4,代码来源:AbstractModel.php


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