Commit fe14f0c5 by Carsten Brandt

fixed all the PHPdoc in extensions

parent 91965fd3
...@@ -202,39 +202,50 @@ class PhpDocController extends Controller ...@@ -202,39 +202,50 @@ class PhpDocController extends Controller
{ {
$docBlock = false; $docBlock = false;
$codeBlock = false; $codeBlock = false;
$listIndent = false; $listIndent = '';
$tag = false;
$indent = ''; $indent = '';
foreach($lines as $i => $line) { foreach($lines as $i => $line) {
if (preg_match('~^(\s*)/\*\*$~', $line, $matches)) { if (preg_match('~^(\s*)/\*\*$~', $line, $matches)) {
$docBlock = true; $docBlock = true;
$indent = $matches[1]; $indent = $matches[1];
} elseif (preg_match('~^(\s+)\*+/~', $line)) { } elseif (preg_match('~^(\s*)\*+/~', $line)) {
if ($docBlock) { // could be the end of normal comment if ($docBlock) { // could be the end of normal comment
$lines[$i] = $indent . ' */'; $lines[$i] = $indent . ' */';
} }
$docBlock = false; $docBlock = false;
$codeBlock = false; $codeBlock = false;
$listIndent = ''; $listIndent = '';
$tag = false;
} elseif ($docBlock) { } 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)) { if (empty($docLine)) {
$listIndent = ''; $listIndent = '';
} elseif ($docLine[0] === '@') { } elseif ($docLine[0] === '@') {
$listIndent = ''; $listIndent = '';
$codeBlock = false; $codeBlock = false;
$tag = true;
$docLine = preg_replace('/\s+/', ' ', $docLine); $docLine = preg_replace('/\s+/', ' ', $docLine);
} elseif (preg_match('/^(~~~|```)/', $docLine)) { } elseif (preg_match('/^(~~~|```)/', $docLine)) {
$codeBlock = !$codeBlock; $codeBlock = !$codeBlock;
$listIndent = ''; $listIndent = '';
} elseif (preg_match('/^(\s*)([0-9]+\.|-|\*|\+) /', $docLine, $matches)) { } elseif (preg_match('/^(\s*)([0-9]+\.|-|\*|\+) /', $docLine, $matches)) {
$listIndent = str_repeat(' ', strlen($matches[0])); $listIndent = str_repeat(' ', strlen($matches[0]));
$tag = false;
$lines[$i] = $indent . ' * ' . $docLine; $lines[$i] = $indent . ' * ' . $docLine;
continue; continue;
} }
if ($codeBlock) { if ($codeBlock) {
$lines[$i] = rtrim($indent . ' * ' . $docLine); $lines[$i] = rtrim($indent . ' * ' . $docLine);
} else { } else {
$lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) ? $docLine : ($listIndent . ltrim($docLine)))); $lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) && !$tag ? $docLine : ($listIndent . ltrim($docLine))));
} }
} }
} }
......
<?php <?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\codeception; namespace yii\codeception;
......
...@@ -196,12 +196,12 @@ class Installer extends LibraryInstaller ...@@ -196,12 +196,12 @@ class Installer extends LibraryInstaller
file_put_contents($yiiDir . '/' . $file, <<<EOF file_put_contents($yiiDir . '/' . $file, <<<EOF
<?php <?php
/** /**
* This is a link provided by the yiisoft/yii2-dev package via yii2-composer plugin. * This is a link provided by the yiisoft/yii2-dev package via yii2-composer plugin.
* *
* @link http://www.yiiframework.com/ * @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
return require(__DIR__ . '/../yii2-dev/framework/$file'); return require(__DIR__ . '/../yii2-dev/framework/$file');
......
...@@ -186,8 +186,10 @@ class Query extends Component implements QueryInterface ...@@ -186,8 +186,10 @@ class Query extends Component implements QueryInterface
* @param Connection $db the database connection used to execute the query. * @param Connection $db the database connection used to execute the query.
* If this parameter is not given, the `elasticsearch` application component will be used. * 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: * @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) * - [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) * - [search_type](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html)
*
* @return array the query results. * @return array the query results.
*/ */
public function search($db = null, $options = []) public function search($db = null, $options = [])
......
...@@ -33,7 +33,7 @@ use yii\helpers\Html; ...@@ -33,7 +33,7 @@ use yii\helpers\Html;
* 'source' => ['USA', 'RUS'], * 'source' => ['USA', 'RUS'],
* ], * ],
* ]); * ]);
*``` * ```
* *
* @see http://api.jqueryui.com/autocomplete/ * @see http://api.jqueryui.com/autocomplete/
* @author Alexander Kochetov <creocoder@gmail.com> * @author Alexander Kochetov <creocoder@gmail.com>
......
...@@ -37,7 +37,7 @@ use yii\helpers\Json; ...@@ -37,7 +37,7 @@ use yii\helpers\Json;
* 'dateFormat' => 'yy-mm-dd', * 'dateFormat' => 'yy-mm-dd',
* ], * ],
* ]); * ]);
*``` * ```
* *
* @see http://api.jqueryui.com/datepicker/ * @see http://api.jqueryui.com/datepicker/
* @author Alexander Kochetov <creocoder@gmail.com> * @author Alexander Kochetov <creocoder@gmail.com>
......
...@@ -29,7 +29,7 @@ use yii\helpers\Html; ...@@ -29,7 +29,7 @@ use yii\helpers\Html;
* 'name' => 'country', * 'name' => 'country',
* 'clientOptions' => ['step' => 2], * 'clientOptions' => ['step' => 2],
* ]); * ]);
*``` * ```
* *
* @see http://api.jqueryui.com/spinner/ * @see http://api.jqueryui.com/spinner/
* @author Alexander Kochetov <creocoder@gmail.com> * @author Alexander Kochetov <creocoder@gmail.com>
......
...@@ -101,10 +101,12 @@ abstract class ActiveRecord extends BaseActiveRecord ...@@ -101,10 +101,12 @@ abstract class ActiveRecord extends BaseActiveRecord
/** /**
* Declares the name of the Mongo collection associated with this AR class. * Declares the name of the Mongo collection associated with this AR class.
*
* Collection name can be either a string or array: * Collection name can be either a string or array:
* - if string considered as the name of the collection inside the default database. * - 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 * - if array - first element considered as the name of the database, second - as
* name of collection inside that database * name of collection inside that database
*
* By default this method returns the class name as the collection name by calling [[Inflector::camel2id()]]. * By default this method returns the class name as the collection name by calling [[Inflector::camel2id()]].
* For example, 'Customer' becomes 'customer', and 'OrderItem' becomes * For example, 'Customer' becomes 'customer', and 'OrderItem' becomes
* 'order_item'. You may override this method if the table is not named after this convention. * 'order_item'. You may override this method if the table is not named after this convention.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment