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


PHP AbstractObject::handleCommand方法代码示例

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


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

示例1: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'method':
             // alias
         // alias
         case 'operation':
             $method = strtolower(self::words_shift($data));
             if (!in_array($method, self::$methods)) {
                 throw new \SwaggerGen\Exception("Unrecognized operation method '{$method}'.");
             }
             if (isset($this->operations[$method])) {
                 $Operation = $this->operations[$method];
             } else {
                 $summary = $data;
                 $Operation = new Operation($this, $summary, $this->tag);
                 $this->operations[$method] = $Operation;
             }
             return $Operation;
         case 'description':
             if ($this->tag) {
                 return $this->tag->handleCommand($command, $data);
             }
             break;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:27,代码来源:Path.php

示例2: handleCommand

 public function handleCommand($command, $data = null)
 {
     // Pass through to Type
     if ($this->Type && $this->Type->handleCommand($command, $data)) {
         return $this;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:8,代码来源:Parameter.php

示例3: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'description':
             $this->description = $data;
             return $this;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:9,代码来源:Header.php

示例4: handleCommand

 public function handleCommand($command, $data = null)
 {
     // Pass through to Type
     $return = $this->schema->handleCommand($command, $data);
     if ($return) {
         return $return;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:9,代码来源:BodyParameter.php

示例5: handleCommand

 /**
  * @param string $command
  * @param string $data
  * @return AbstractObject
  */
 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'doc':
         case 'docs':
             $url = self::words_shift($data);
             $this->externalDocs = new ExternalDocumentation($this, $url, $data);
             return $this->externalDocs;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:16,代码来源:AbstractDocumentableObject.php

示例6: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'name':
         case 'url':
         case 'email':
             $this->{$command} = $data;
             return $this;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:11,代码来源:Contact.php

示例7: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'name':
             $this->name = $data;
             if (empty($this->url) && !empty(self::$licenses[strtolower($data)])) {
                 $this->url = self::$licenses[strtolower($data)];
             }
             return $this;
         case 'url':
             $this->url = $data;
             return $this;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:15,代码来源:License.php

示例8: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'title':
         case 'description':
         case 'termsofservice':
         case 'version':
             $this->{$command} = $data;
             return $this;
         case 'terms':
             // alias
         // alias
         case 'tos':
             // alias
             $this->termsofservice = $data;
             return $this;
         case 'contact':
             $name = array();
             $url = null;
             $email = null;
             foreach (self::words_split($data) as $word) {
                 if (filter_var($word, FILTER_VALIDATE_URL)) {
                     $url = $word;
                 } elseif (filter_var($word, FILTER_VALIDATE_EMAIL)) {
                     $email = $word;
                 } else {
                     $name[] = $word;
                 }
             }
             $name = join(' ', array_filter($name));
             $this->contact = new Contact($this, $name, $url, $email);
             return $this->contact;
         case 'license':
             $name = array();
             $url = null;
             foreach (self::words_split($data) as $word) {
                 if (filter_var($word, FILTER_VALIDATE_URL)) {
                     $url = $word;
                 } else {
                     $name[] = $word;
                 }
             }
             $name = join(' ', array_filter($name));
             $this->license = new License($this, $name, $url);
             return $this->license;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:48,代码来源:Info.php

示例9: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'description':
             $this->description = $data;
             return $this;
         case 'scope':
             if ($this->type !== 'oauth2') {
                 throw new \SwaggerGen\Exception("Cannot set scope on type '{$this->type}'");
             }
             $name = self::words_shift($data);
             $this->scopes[$name] = $data;
             return $this;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:16,代码来源:SecurityScheme.php

示例10: handleCommand

 public function handleCommand($command, $data = null)
 {
     switch (strtolower($command)) {
         case 'header':
             $type = self::words_shift($data);
             $name = self::words_shift($data);
             $Header = new Header($this, $type, $data);
             $this->Headers[$name] = $Header;
             return $Header;
     }
     return parent::handleCommand($command, $data);
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:12,代码来源:Response.php


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