mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
fixed all the PHPdoc in extensions
This commit is contained in:
@ -202,39 +202,50 @@ class PhpDocController extends Controller
|
||||
{
|
||||
$docBlock = false;
|
||||
$codeBlock = false;
|
||||
$listIndent = false;
|
||||
$listIndent = '';
|
||||
$tag = false;
|
||||
$indent = '';
|
||||
foreach($lines as $i => $line) {
|
||||
if (preg_match('~^(\s*)/\*\*$~', $line, $matches)) {
|
||||
$docBlock = true;
|
||||
$indent = $matches[1];
|
||||
} elseif (preg_match('~^(\s+)\*+/~', $line)) {
|
||||
} elseif (preg_match('~^(\s*)\*+/~', $line)) {
|
||||
if ($docBlock) { // could be the end of normal comment
|
||||
$lines[$i] = $indent . ' */';
|
||||
}
|
||||
$docBlock = false;
|
||||
$codeBlock = false;
|
||||
$listIndent = '';
|
||||
$tag = false;
|
||||
} elseif ($docBlock) {
|
||||
$docLine = str_replace("\t", ' ', rtrim(substr(ltrim($line), 2)));
|
||||
$line = ltrim($line);
|
||||
if (isset($line[0]) && $line[0] === '*') {
|
||||
$line = substr($line, 1);
|
||||
}
|
||||
if (isset($line[0]) && $line[0] === ' ') {
|
||||
$line = substr($line, 1);
|
||||
}
|
||||
$docLine = str_replace("\t", ' ', rtrim($line));
|
||||
if (empty($docLine)) {
|
||||
$listIndent = '';
|
||||
} elseif ($docLine[0] === '@') {
|
||||
$listIndent = '';
|
||||
$codeBlock = false;
|
||||
$tag = true;
|
||||
$docLine = preg_replace('/\s+/', ' ', $docLine);
|
||||
} elseif (preg_match('/^(~~~|```)/', $docLine)) {
|
||||
$codeBlock = !$codeBlock;
|
||||
$listIndent = '';
|
||||
} elseif (preg_match('/^(\s*)([0-9]+\.|-|\*|\+) /', $docLine, $matches)) {
|
||||
$listIndent = str_repeat(' ', strlen($matches[0]));
|
||||
$tag = false;
|
||||
$lines[$i] = $indent . ' * ' . $docLine;
|
||||
continue;
|
||||
}
|
||||
if ($codeBlock) {
|
||||
$lines[$i] = rtrim($indent . ' * ' . $docLine);
|
||||
} else {
|
||||
$lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) ? $docLine : ($listIndent . ltrim($docLine))));
|
||||
$lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) && !$tag ? $docLine : ($listIndent . ltrim($docLine))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace yii\codeception;
|
||||
|
||||
|
@ -186,8 +186,10 @@ class Query extends Component implements QueryInterface
|
||||
* @param Connection $db the database connection used to execute the query.
|
||||
* If this parameter is not given, the `elasticsearch` application component will be used.
|
||||
* @param array $options The options given with this query. Possible options are:
|
||||
*
|
||||
* - [routing](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html#search-routing)
|
||||
* - [search_type](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html)
|
||||
*
|
||||
* @return array the query results.
|
||||
*/
|
||||
public function search($db = null, $options = [])
|
||||
|
@ -101,10 +101,12 @@ abstract class ActiveRecord extends BaseActiveRecord
|
||||
|
||||
/**
|
||||
* Declares the name of the Mongo collection associated with this AR class.
|
||||
*
|
||||
* Collection name can be either a string or array:
|
||||
* - if string considered as the name of the collection inside the default database.
|
||||
* - if array - first element considered as the name of the database, second - as
|
||||
* name of collection inside that database
|
||||
*
|
||||
* By default this method returns the class name as the collection name by calling [[Inflector::camel2id()]].
|
||||
* For example, 'Customer' becomes 'customer', and 'OrderItem' becomes
|
||||
* 'order_item'. You may override this method if the table is not named after this convention.
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Simple file system wrapper for twig to process twig files
|
||||
*
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
|
Reference in New Issue
Block a user