本文整理汇总了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);
}
示例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);
}
示例3: handleCommand
public function handleCommand($command, $data = null)
{
switch (strtolower($command)) {
case 'description':
$this->description = $data;
return $this;
}
return parent::handleCommand($command, $data);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}