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


PHP Comment::__construct方法代码示例

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


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

示例1: __construct

 /**
  * @param string $class
  * @param string $phpDoc
  */
 public function __construct(string $class, string $phpDoc)
 {
     $phpDoc = trim(preg_replace('`[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ \\t]*(.*)?`', '$1', $phpDoc));
     $explode = explode(' ', str_replace(["\n", "\r"], ["\n ", ''], $phpDoc));
     $type = array_pop($explode);
     $subType = null;
     if (stripos($type, 'map[') === 0) {
         $subType = substr($type, 4, -1);
         $type = array_pop($explode);
     }
     if ($type == '$this') {
         $type = $class;
     } elseif ($type == '$this') {
         $type = $class . '[]';
     }
     $this->type = explode('|', $type);
     $this->subType = $subType;
     // remove @var
     array_pop($explode);
     if (array_search("@nullable\n", $explode) !== false) {
         $this->nullable = true;
         unset($explode[array_search("@nullable\n", $explode)]);
     }
     $comment = trim(implode(' ', $explode));
     parent::__construct($comment);
 }
开发者ID:cawaphp,项目名称:module-swagger-server,代码行数:30,代码来源:Property.php

示例2: __construct

 public function __construct($content = false)
 {
     parent::__construct($content);
     $this->before = '/**';
     $this->into = ' * ';
     $this->after = ' */';
     $this->allowOneLine = false;
 }
开发者ID:RapotOR,项目名称:PhpCoder,代码行数:8,代码来源:PhpDoc.php

示例3: __construct

 /**
  * @param array $explode
  */
 public function __construct(array $explode)
 {
     $this->type = array_shift($explode);
     $statusCode = array_shift($explode);
     if (is_numeric($statusCode) && $statusCode >= 100 && $statusCode < 700) {
         $this->statusCode = (int) $statusCode;
     } else {
         $this->statusCode = 500;
         array_unshift($explode, $statusCode);
     }
     parent::__construct(implode(' ', $explode));
 }
开发者ID:cawaphp,项目名称:module-swagger-server,代码行数:15,代码来源:Throws.php

示例4: __construct

 /**
  * @param array $explode
  */
 public function __construct(array $explode = null)
 {
     if (!is_null($explode)) {
         $statusCode = array_shift($explode);
         if (is_numeric($statusCode) && $statusCode >= 100 && $statusCode < 700) {
             $this->statusCode = (int) $statusCode;
         } else {
             $this->statusCode = 200;
             array_unshift($explode, $statusCode);
         }
         if ($this->statusCode !== 204) {
             $this->type = explode('|', trim(array_shift($explode)));
         }
         parent::__construct(implode(' ', $explode));
     }
 }
开发者ID:cawaphp,项目名称:module-swagger-server,代码行数:19,代码来源:Response.php

示例5: __construct

 /**
  * @param array $explode
  */
 public function __construct(array $explode)
 {
     $statusCode = array_shift($explode);
     if (is_numeric($statusCode) && $statusCode >= 100 && $statusCode < 700) {
         $this->statusCode = (int) $statusCode;
     } else {
         $this->statusCode = 200;
         array_unshift($explode, $statusCode);
     }
     $comments = [];
     while (substr($explode[0], 0, 1) !== '{') {
         $comments[] = array_shift($explode);
     }
     $this->example = json_decode(implode(' ', $explode), true);
     parent::__construct(implode(' ', $comments));
 }
开发者ID:cawaphp,项目名称:module-swagger-server,代码行数:19,代码来源:Example.php

示例6: __construct

 /**
  * @param array $explode
  */
 public function __construct(array $explode)
 {
     $this->type = explode('|', trim(array_shift($explode)));
     parent::__construct(implode(' ', $explode));
 }
开发者ID:cawaphp,项目名称:module-swagger-server,代码行数:8,代码来源:ReturnType.php

示例7: __construct

	public function __construct()
	{
		parent::__construct();
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:4,代码来源:comment.model.Test.php


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