Skip to content

Commit

Permalink
Fixed missing and incorrect phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Jul 25, 2014
1 parent d8c2f05 commit 0edd8bc
Show file tree
Hide file tree
Showing 19 changed files with 106 additions and 5 deletions.
1 change: 1 addition & 0 deletions framework/base/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ protected function bootstrap()

/**
* Registers the errorHandler component as a PHP error handler.
* @param array $config application config
*/
protected function registerErrorHandler(&$config)
{
Expand Down
18 changes: 18 additions & 0 deletions framework/console/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ protected function identifyLine($lines, $current)

/**
* Consume lines for a fenced code block
*
* @param array $lines
* @param integer $current
* @return array
*/
protected function consumeFencedCode($lines, $current)
{
Expand All @@ -70,12 +74,18 @@ protected function consumeFencedCode($lines, $current)

/**
* 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";
Expand All @@ -97,6 +107,8 @@ protected function inlineMarkers()

/**
* Parses an inline code span `` ` ``.
* @param string $text
* @return array
*/
protected function parseCode($text)
{
Expand All @@ -120,6 +132,8 @@ protected function parseCode($text)

/**
* Parses empathized and strong elements.
* @param string $text
* @return array
*/
protected function parseEmphStrong($text)
{
Expand All @@ -146,6 +160,8 @@ protected function parseEmphStrong($text)

/**
* Parses the strikethrough feature.
* @param string $markdown
* @return array
*/
protected function parseStrike($markdown)
{
Expand All @@ -160,6 +176,8 @@ protected function parseStrike($markdown)

/**
* Parses escaped special characters.
* @param string $text
* @return array
*/
protected function parseEscape($text)
{
Expand Down
6 changes: 4 additions & 2 deletions framework/console/controllers/BaseMigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ public function actionMark($version)
*
* @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)
{
Expand All @@ -371,7 +372,7 @@ public function actionHistory($limit = 10)
} 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.");
}
}

Expand Down Expand Up @@ -406,6 +407,7 @@ public function actionHistory($limit = 10)
*
* @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)
{
Expand All @@ -414,7 +416,7 @@ public function actionNew($limit = 10)
} 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.");
}
}

Expand Down
2 changes: 2 additions & 0 deletions framework/db/BaseActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ public function updateAttributes($attributes)

/**
* @see update()
* @param array $attributes attributes to update
* @return integer number of rows updated
* @throws StaleObjectException
*/
protected function updateInternal($attributes = null)
Expand Down
3 changes: 3 additions & 0 deletions framework/db/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public function getName()
return 'Database Exception';
}

/**
* @return string readable representation of exception
*/
public function __toString()
{
return parent::__toString() . PHP_EOL
Expand Down
16 changes: 16 additions & 0 deletions framework/db/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,13 @@ public function buildJoin($joins, &$params)
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) {
Expand Down Expand Up @@ -1077,6 +1084,15 @@ public function buildInCondition($operator, $operands, &$params)
}
}

/**
* 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 = [];
Expand Down
6 changes: 6 additions & 0 deletions framework/db/QueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ public function addOrderBy($columns)
return $this;
}

/**
* Normalizes format of ORDER BY data
*
* @param array|string $columns
* @return array
*/
protected function normalizeOrderBy($columns)
{
if (is_array($columns)) {
Expand Down
3 changes: 3 additions & 0 deletions framework/db/mssql/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public function rollBack()
* 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)
{
Expand Down
3 changes: 3 additions & 0 deletions framework/db/oci/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public function build($query, $params = [])
return [$this->_sql, $params];
}

/**
* @inheritdoc
*/
public function buildLimit($limit, $offset)
{
$filters = [];
Expand Down
12 changes: 11 additions & 1 deletion framework/db/oci/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function getTableSequenceName($tablename){
return $this->db->createCommand($seq_name_sql)->queryScalar();
}

/*
/**
* @Overrides method in class 'Schema'
* @see http:https://www.php.net/manual/en/function.PDO-lastInsertId.php -> Oracle does not support this
*
Expand All @@ -189,6 +189,12 @@ public function getLastInsertID($sequenceName = '')
}
}

/**
* Creates ColumnSchema instance
*
* @param array $column
* @return ColumnSchema
*/
protected function createColumn($column)
{
$c = new ColumnSchema();
Expand All @@ -211,6 +217,10 @@ protected function createColumn($column)
return $c;
}

/**
* Finds constraints and fills them into TableSchema object passed
* @param TableSchema $table
*/
protected function findConstraints($table)
{
$sql = <<<EOD
Expand Down
2 changes: 2 additions & 0 deletions framework/helpers/BaseConsole.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ function ($ansi) use (&$tags, $styleMap) {

/**
* Converts Markdown to be better readable in console environments by applying some ANSI format
* @param string $markdown
* @return string
*/
public static function markdownToAnsi($markdown)
{
Expand Down
2 changes: 1 addition & 1 deletion framework/helpers/BaseInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public static function camel2words($name, $ucwords = true)
* 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)
Expand Down
11 changes: 11 additions & 0 deletions framework/rbac/migrations/m140506_102106_rbac_init.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<?php
/**
* @link http:https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http:https://www.yiiframework.com/license/
*/

use yii\base\InvalidConfigException;
use yii\db\Schema;
use yii\rbac\DbManager;

/**
* Initializes RBAC tables
*
* @author Alexander Kochetov <[email protected]>
* @since 2.0
*/
class m140506_102106_rbac_init extends \yii\db\Migration
{
/**
Expand Down
1 change: 1 addition & 0 deletions framework/rest/DeleteAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 4 additions & 1 deletion framework/validators/FileValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ protected function validateExtension($file)

return true;
}


/**
* @inheritdoc
*/
public function clientValidateAttribute($object, $attribute, $view) {
$label = $object->getAttributeLabel($attribute);

Expand Down
1 change: 1 addition & 0 deletions framework/validators/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
Expand Down
5 changes: 5 additions & 0 deletions framework/web/ErrorAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions framework/web/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,13 @@ public function validateCsrfToken()
|| $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));
Expand Down
7 changes: 7 additions & 0 deletions framework/widgets/FragmentCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ public function getCachedContent()
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) {
Expand Down

0 comments on commit 0edd8bc

Please sign in to comment.