本文整理汇总了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);
}
示例2: __construct
public function __construct($content = false)
{
parent::__construct($content);
$this->before = '/**';
$this->into = ' * ';
$this->after = ' */';
$this->allowOneLine = false;
}
示例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));
}
示例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));
}
}
示例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));
}
示例6: __construct
/**
* @param array $explode
*/
public function __construct(array $explode)
{
$this->type = explode('|', trim(array_shift($explode)));
parent::__construct(implode(' ', $explode));
}
示例7: __construct
public function __construct()
{
parent::__construct();
}