Commit 91965fd3 by Carsten Brandt

phpdoc formatting issues

parent 12d34849
......@@ -205,16 +205,18 @@ class PhpDocController extends Controller
$listIndent = false;
$indent = '';
foreach($lines as $i => $line) {
if (preg_match('~^(\s+)/\*\*$~', $line, $matches)) {
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 = '';
$lines[$i] = $indent . ' */';
} elseif ($docBlock) {
$docLine = trim($line, " \t*");
$docLine = str_replace("\t", ' ', rtrim(substr(ltrim($line), 2)));
if (empty($docLine)) {
$listIndent = '';
} elseif ($docLine[0] === '@') {
......@@ -223,15 +225,16 @@ class PhpDocController extends Controller
$docLine = preg_replace('/\s+/', ' ', $docLine);
} elseif (preg_match('/^(~~~|```)/', $docLine)) {
$codeBlock = !$codeBlock;
} elseif (preg_match('/^([0-9]+\.|-|\*|\+) /', $docLine, $matches)) {
$listIndent = '';
} elseif (preg_match('/^(\s*)([0-9]+\.|-|\*|\+) /', $docLine, $matches)) {
$listIndent = str_repeat(' ', strlen($matches[0]));
$lines[$i] = $indent . ' * ' . $docLine;
continue;
}
if ($codeBlock) {
$lines[$i] = rtrim($indent . ' * ' . substr(ltrim($line), 2));
$lines[$i] = rtrim($indent . ' * ' . $docLine);
} else {
$lines[$i] = rtrim($indent . ' * ' . $listIndent . $docLine);
$lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) ? $docLine : ($listIndent . ltrim($docLine))));
}
}
}
......
......@@ -4,6 +4,7 @@
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii;
use yii\base\InvalidConfigException;
......
......@@ -171,7 +171,7 @@ class Widget extends Component implements ViewContextInterface
* - relative path (e.g. "index"): the actual view file will be looked for under [[viewPath]].
*
* If the view name does not contain a file extension, it will use the default one `.php`.
*
* @param string $view the view name.
* @param array $params the parameters (name-value pairs) that should be made available in the view.
* @return string the rendering result.
......
......@@ -69,7 +69,7 @@ class DbCache extends Cache
* @var integer the probability (parts per million) that garbage collection (GC) should be performed
* when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance.
* This number should be between 0 and 1000000. A value 0 meaning no GC will be performed at all.
**/
*/
public $gcProbability = 100;
/**
......
......@@ -52,7 +52,7 @@ class FileCache extends Cache
* @var integer the probability (parts per million) that garbage collection (GC) should be performed
* when storing a piece of data in the cache. Defaults to 10, meaning 0.001% chance.
* This number should be between 0 and 1000000. A value 0 means no GC will be performed at all.
**/
*/
public $gcProbability = 10;
/**
* @var integer the permission to be set for newly created cache files.
......
......@@ -82,7 +82,7 @@ class CaptchaAction extends Action
/**
* @var integer the offset between characters. Defaults to -2. You can adjust this property
* in order to decrease or increase the readability of the captcha.
**/
*/
public $offset = -2;
/**
* @var string the TrueType font file. This can be either a file path or path alias.
......
......@@ -76,7 +76,6 @@ use yii\caching\Cache;
* configuration like the following:
*
* ~~~
* [
* 'components' => [
* 'db' => [
* 'class' => '\yii\db\Connection',
......@@ -86,7 +85,6 @@ use yii\caching\Cache;
* 'charset' => 'utf8',
* ],
* ],
* ]
* ~~~
*
* @property string $driverName Name of the DB driver.
......
......@@ -350,7 +350,7 @@ class QueryBuilder extends \yii\base\Object
* Builds a SQL statement for removing a primary key constraint to an existing table.
* @param string $name the name of the primary key constraint to be removed.
* @param string $table the table that the primary key constraint will be removed from.
* @return string the SQL statement for removing a primary key constraint from an existing table. *
* @return string the SQL statement for removing a primary key constraint from an existing table.
*/
public function dropPrimaryKey($name, $table)
{
......
......@@ -254,7 +254,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @param string $name the name of the primary key constraint to be removed.
* @param string $table the table that the primary key constraint will be removed from.
* @return string the SQL statement for removing a primary key constraint from an existing table.
* @throws NotSupportedException this is not supported by SQLite *
* @throws NotSupportedException this is not supported by SQLite
*/
public function dropPrimaryKey($name, $table)
{
......
......@@ -33,7 +33,7 @@ class RangeValidator extends Validator
/**
* @var boolean whether to invert the validation logic. Defaults to false. If set to true,
* the attribute value should NOT be among the list of values defined via [[range]].
**/
*/
public $not = false;
/**
......
......@@ -29,7 +29,7 @@ class RegularExpressionValidator extends Validator
/**
* @var boolean whether to invert the validation logic. Defaults to false. If set to true,
* the regular expression defined via [[pattern]] should NOT match the attribute value.
**/
*/
public $not = false;
/**
......
......@@ -32,13 +32,13 @@ class UrlValidator extends Validator
/**
* @var array list of URI schemes which should be considered valid. By default, http and https
* are considered to be valid schemes.
**/
*/
public $validSchemes = ['http', 'https'];
/**
* @var string the default URI scheme. If the input doesn't contain the scheme part, the default
* scheme will be prepended to it (thus changing the input). Defaults to null, meaning a URL must
* contain the scheme part.
**/
*/
public $defaultScheme;
/**
* @var boolean whether validation process should take into account IDN (internationalized
......
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