Commit 0edd8bc6 by Alexander Makarov

Fixed missing and incorrect phpdoc

parent d8c2f05d
......@@ -316,6 +316,7 @@ abstract class Application extends Module
/**
* Registers the errorHandler component as a PHP error handler.
* @param array $config application config
*/
protected function registerErrorHandler(&$config)
{
......
......@@ -44,6 +44,10 @@ class Markdown extends \cebe\markdown\Parser
/**
* Consume lines for a fenced code block
*
* @param array $lines
* @param integer $current
* @return array
*/
protected function consumeFencedCode($lines, $current)
{
......@@ -70,12 +74,18 @@ class Markdown extends \cebe\markdown\Parser
/**
* Renders a code block
*
* @param array $block
* @return string
*/
protected function renderCode($block)
{
return Console::ansiFormat(implode("\n", $block['content']), [Console::BG_GREY]) . "\n";
}
/**
* @inheritdoc
*/
protected function renderParagraph($block)
{
return rtrim($this->parseInline(implode("\n", $block['content']))) . "\n";
......@@ -97,6 +107,8 @@ class Markdown extends \cebe\markdown\Parser
/**
* Parses an inline code span `` ` ``.
* @param string $text
* @return array
*/
protected function parseCode($text)
{
......@@ -120,6 +132,8 @@ class Markdown extends \cebe\markdown\Parser
/**
* Parses empathized and strong elements.
* @param string $text
* @return array
*/
protected function parseEmphStrong($text)
{
......@@ -146,6 +160,8 @@ class Markdown extends \cebe\markdown\Parser
/**
* Parses the strikethrough feature.
* @param string $markdown
* @return array
*/
protected function parseStrike($markdown)
{
......@@ -160,6 +176,8 @@ class Markdown extends \cebe\markdown\Parser
/**
* Parses escaped special characters.
* @param string $text
* @return array
*/
protected function parseEscape($text)
{
......
......@@ -363,6 +363,7 @@ abstract class BaseMigrateController extends Controller
*
* @param integer $limit the maximum number of migrations to be displayed.
* If it is 0, the whole migration history will be displayed.
* @throws \yii\console\Exception if invalid limit value passed
*/
public function actionHistory($limit = 10)
{
......@@ -371,7 +372,7 @@ abstract class BaseMigrateController extends Controller
} else {
$limit = (int) $limit;
if ($limit < 1) {
throw new Exception("The step argument must be greater than 0.");
throw new Exception("The limit must be greater than 0.");
}
}
......@@ -406,6 +407,7 @@ abstract class BaseMigrateController extends Controller
*
* @param integer $limit the maximum number of new migrations to be displayed.
* If it is 0, all available new migrations will be displayed.
* @throws \yii\console\Exception if invalid limit value passed
*/
public function actionNew($limit = 10)
{
......@@ -414,7 +416,7 @@ abstract class BaseMigrateController extends Controller
} else {
$limit = (int) $limit;
if ($limit < 1) {
throw new Exception("The step argument must be greater than 0.");
throw new Exception("The limit must be greater than 0.");
}
}
......
......@@ -686,6 +686,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
/**
* @see update()
* @param array $attributes attributes to update
* @return integer number of rows updated
* @throws StaleObjectException
*/
protected function updateInternal($attributes = null)
......
......@@ -42,6 +42,9 @@ class Exception extends \yii\base\Exception
return 'Database Exception';
}
/**
* @return string readable representation of exception
*/
public function __toString()
{
return parent::__toString() . PHP_EOL
......
......@@ -689,6 +689,13 @@ class QueryBuilder extends \yii\base\Object
return implode($this->separator, $joins);
}
/**
* Quotes table names passed
*
* @param array $tables
* @param array $params
* @return array
*/
private function quoteTableNames($tables, &$params)
{
foreach ($tables as $i => $table) {
......@@ -1077,6 +1084,15 @@ class QueryBuilder extends \yii\base\Object
}
}
/**
* Builds SQL for IN condition
*
* @param string $operator
* @param array $columns
* @param array $values
* @param array $params
* @return string SQL
*/
protected function buildCompositeInCondition($operator, $columns, $values, &$params)
{
$vss = [];
......
......@@ -342,6 +342,12 @@ trait QueryTrait
return $this;
}
/**
* Normalizes format of ORDER BY data
*
* @param array|string $columns
* @return array
*/
protected function normalizeOrderBy($columns)
{
if (is_array($columns)) {
......
......@@ -66,6 +66,9 @@ class PDO extends \PDO
* Retrieve a database connection attribute.
* It is necessary to override PDO's method as some MSSQL PDO driver (e.g. dblib) does not
* support getting attributes
* @param integer $attribute One of the PDO::ATTR_* constants.
* @return mixed A successful call returns the value of the requested PDO attribute.
* An unsuccessful call returns null.
*/
public function getAttribute($attribute)
{
......
......@@ -72,6 +72,9 @@ class QueryBuilder extends \yii\db\QueryBuilder
return [$this->_sql, $params];
}
/**
* @inheritdoc
*/
public function buildLimit($limit, $offset)
{
$filters = [];
......
......@@ -168,7 +168,7 @@ EOD;
return $this->db->createCommand($seq_name_sql)->queryScalar();
}
/*
/**
* @Overrides method in class 'Schema'
* @see http://www.php.net/manual/en/function.PDO-lastInsertId.php -> Oracle does not support this
*
......@@ -189,6 +189,12 @@ EOD;
}
}
/**
* Creates ColumnSchema instance
*
* @param array $column
* @return ColumnSchema
*/
protected function createColumn($column)
{
$c = new ColumnSchema();
......@@ -211,6 +217,10 @@ EOD;
return $c;
}
/**
* Finds constraints and fills them into TableSchema object passed
* @param TableSchema $table
*/
protected function findConstraints($table)
{
$sql = <<<EOD
......
......@@ -453,6 +453,8 @@ class BaseConsole
/**
* Converts Markdown to be better readable in console environments by applying some ANSI format
* @param string $markdown
* @return string
*/
public static function markdownToAnsi($markdown)
{
......
......@@ -326,7 +326,7 @@ class BaseInflector
* For example, 'PostTag' will be converted to 'post-tag'.
* @param string $name the string to be converted
* @param string $separator the character used to concatenate the words in the ID
* @param string $strict whether to insert a separator between two consecutive uppercase chars, defaults to false
* @param boolean|string $strict whether to insert a separator between two consecutive uppercase chars, defaults to false
* @return string the resulting ID
*/
public static function camel2id($name, $separator = '-', $strict = false)
......
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
use yii\base\InvalidConfigException;
use yii\db\Schema;
use yii\rbac\DbManager;
/**
* Initializes RBAC tables
*
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0
*/
class m140506_102106_rbac_init extends \yii\db\Migration
{
/**
......
......@@ -19,6 +19,7 @@ class DeleteAction extends Action
{
/**
* Deletes a model.
* @param mixed $id id of the model to be deleted.
*/
public function run($id)
{
......
......@@ -326,7 +326,10 @@ class FileValidator extends Validator
return true;
}
/**
* @inheritdoc
*/
public function clientValidateAttribute($object, $attribute, $view) {
$label = $object->getAttributeLabel($attribute);
......
......@@ -181,6 +181,7 @@ class Validator extends Component
* @param array|string $attributes list of attributes to be validated. This can be either an array of
* the attribute names or a string of comma-separated attribute names.
* @param array $params initial values to be applied to the validator properties
* @throws \yii\base\InvalidConfigException if type can't be recognized
* @return Validator the validator
*/
public static function createValidator($type, $object, $attributes, $params = [])
......
......@@ -66,6 +66,11 @@ class ErrorAction extends Action
*/
public $defaultMessage;
/**
* Runs the action
*
* @return string result content
*/
public function run()
{
if (($exception = Yii::$app->getErrorHandler()->exception) === null) {
......
......@@ -1329,6 +1329,13 @@ class Request extends \yii\base\Request
|| $this->validateCsrfTokenInternal($this->getCsrfTokenFromHeader(), $trueToken);
}
/**
* Validates CSRF token
*
* @param string $token
* @param string $trueToken
* @return boolean
*/
private function validateCsrfTokenInternal($token, $trueToken)
{
$token = base64_decode(str_replace('.', '+', $token));
......
......@@ -150,6 +150,13 @@ class FragmentCache extends Widget
return $this->_content;
}
/**
* Replaces placeholders in content by results of evaluated dynamic statemens
*
* @param string $content
* @param array $placeholders
* @return string final content
*/
protected function updateDynamicContent($content, $placeholders)
{
foreach ($placeholders as $name => $statements) {
......
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