Commit 0edd8bc6 by Alexander Makarov

Fixed missing and incorrect phpdoc

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