From 7fa81949bfbc3736cb35dd59acb76be2f5571167 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 1 Sep 2013 19:47:26 +0200 Subject: [PATCH] various documentation changes --- framework/yii/base/Application.php | 2 +- framework/yii/base/Component.php | 3 +-- framework/yii/base/Formatter.php | 2 +- framework/yii/base/Object.php | 3 +-- framework/yii/bootstrap/Nav.php | 2 +- framework/yii/db/Command.php | 12 ++++++------ framework/yii/db/DataReader.php | 6 +++--- framework/yii/db/Migration.php | 4 ++-- framework/yii/db/QueryBuilder.php | 6 +++--- framework/yii/helpers/ArrayHelperBase.php | 2 +- framework/yii/helpers/ConsoleBase.php | 8 ++++---- framework/yii/validators/FileValidator.php | 2 +- 12 files changed, 25 insertions(+), 27 deletions(-) diff --git a/framework/yii/base/Application.php b/framework/yii/base/Application.php index 9efb6ce..e8c496c 100644 --- a/framework/yii/base/Application.php +++ b/framework/yii/base/Application.php @@ -86,7 +86,7 @@ abstract class Application extends Module */ public $controller; /** - * @var mixed the layout that should be applied for views in this application. Defaults to 'main'. + * @var string|boolean the layout that should be applied for views in this application. Defaults to 'main'. * If this is false, layout will be disabled. */ public $layout = 'main'; diff --git a/framework/yii/base/Component.php b/framework/yii/base/Component.php index b5467a7..c1a2e04 100644 --- a/framework/yii/base/Component.php +++ b/framework/yii/base/Component.php @@ -38,8 +38,7 @@ class Component extends Object * Do not call this method directly as it is a PHP magic method that * will be implicitly called when executing `$value = $component->property;`. * @param string $name the property name - * @return mixed the property value, event handlers attached to the event, - * the behavior, or the value of a behavior's property + * @return mixed the property value or the value of a behavior's property * @throws UnknownPropertyException if the property is not defined * @see __set */ diff --git a/framework/yii/base/Formatter.php b/framework/yii/base/Formatter.php index 50b656a..84b4b8d 100644 --- a/framework/yii/base/Formatter.php +++ b/framework/yii/base/Formatter.php @@ -309,7 +309,7 @@ class Formatter extends Component /** * Normalizes the given datetime value as one that can be taken by various date/time formatting methods. * @param mixed $value the datetime value to be normalized. - * @return mixed the normalized datetime value + * @return integer the normalized datetime value */ protected function normalizeDatetimeValue($value) { diff --git a/framework/yii/base/Object.php b/framework/yii/base/Object.php index 749ad63..9f22aba 100644 --- a/framework/yii/base/Object.php +++ b/framework/yii/base/Object.php @@ -61,8 +61,7 @@ class Object implements Arrayable * Do not call this method directly as it is a PHP magic method that * will be implicitly called when executing `$value = $object->property;`. * @param string $name the property name - * @return mixed the property value, event handlers attached to the event, - * the named behavior, or the value of a behavior's property + * @return mixed the property value * @throws UnknownPropertyException if the property is not defined * @see __set */ diff --git a/framework/yii/bootstrap/Nav.php b/framework/yii/bootstrap/Nav.php index ee103d4..e19eae1 100644 --- a/framework/yii/bootstrap/Nav.php +++ b/framework/yii/bootstrap/Nav.php @@ -137,7 +137,7 @@ class Nav extends Widget /** * Renders a widget's item. - * @param mixed $item the item to render. + * @param string|array $item the item to render. * @return string the rendering result. * @throws InvalidConfigException */ diff --git a/framework/yii/db/Command.php b/framework/yii/db/Command.php index f9376ee..460cd46 100644 --- a/framework/yii/db/Command.php +++ b/framework/yii/db/Command.php @@ -62,7 +62,7 @@ class Command extends \yii\base\Component */ public $pdoStatement; /** - * @var mixed the default fetch mode for this command. + * @var integer the default fetch mode for this command. * @see http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php */ public $fetchMode = \PDO::FETCH_ASSOC; @@ -314,7 +314,7 @@ class Command extends \yii\base\Component /** * Executes the SQL statement and returns ALL rows at once. - * @param mixed $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) + * @param integer $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) * for valid fetch modes. If this parameter is null, the value set in [[fetchMode]] will be used. * @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. @@ -328,7 +328,7 @@ class Command extends \yii\base\Component /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. - * @param mixed $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) + * @param integer $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) * for valid fetch modes. If this parameter is null, the value set in [[fetchMode]] will be used. * @return array|boolean the first row (in terms of an array) of the query result. False is returned if the query * results in nothing. @@ -371,7 +371,7 @@ class Command extends \yii\base\Component /** * Performs the actual DB query of a SQL statement. * @param string $method method of PDOStatement to be called - * @param mixed $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) + * @param integer $fetchMode the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) * for valid fetch modes. If this parameter is null, the value set in [[fetchMode]] will be used. * @return mixed the method execution result * @throws Exception if the query causes any problem @@ -501,7 +501,7 @@ class Command extends \yii\base\Component * * @param string $table the table to be updated. * @param array $columns the column data (name => value) to be updated. - * @param mixed $condition the condition that will be put in the WHERE part. Please + * @param string|array $condition the condition that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify condition. * @param array $params the parameters to be bound to the command * @return Command the command object itself @@ -525,7 +525,7 @@ class Command extends \yii\base\Component * Note that the created command is not executed until [[execute()]] is called. * * @param string $table the table where the data will be deleted from. - * @param mixed $condition the condition that will be put in the WHERE part. Please + * @param string|array $condition the condition that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify condition. * @param array $params the parameters to be bound to the command * @return Command the command object itself diff --git a/framework/yii/db/DataReader.php b/framework/yii/db/DataReader.php index ddfcf29..d18de4c 100644 --- a/framework/yii/db/DataReader.php +++ b/framework/yii/db/DataReader.php @@ -73,7 +73,7 @@ class DataReader extends \yii\base\Object implements \Iterator, \Countable * Binds a column to a PHP variable. * When rows of data are being fetched, the corresponding column value * will be set in the variable. Note, the fetch mode must include PDO::FETCH_BOUND. - * @param mixed $column Number of the column (1-indexed) or name of the column + * @param integer|string $column Number of the column (1-indexed) or name of the column * in the result set. If using the column name, be aware that the name * should match the case of the column, as returned by the driver. * @param mixed $value Name of the PHP variable to which the column will be bound. @@ -91,7 +91,7 @@ class DataReader extends \yii\base\Object implements \Iterator, \Countable /** * Set the default fetch mode for this statement - * @param mixed $mode fetch mode + * @param integer $mode fetch mode * @see http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php */ public function setFetchMode($mode) @@ -112,7 +112,7 @@ class DataReader extends \yii\base\Object implements \Iterator, \Countable /** * Returns a single column from the next row of a result set. * @param integer $columnIndex zero-based column index - * @return mixed the column of the current row, false if no more row available + * @return mixed the column of the current row, false if no more rows available */ public function readColumn($columnIndex) { diff --git a/framework/yii/db/Migration.php b/framework/yii/db/Migration.php index 7c6815b..7368788 100644 --- a/framework/yii/db/Migration.php +++ b/framework/yii/db/Migration.php @@ -162,7 +162,7 @@ class Migration extends \yii\base\Component * The method will properly escape the column names and bind the values to be updated. * @param string $table the table to be updated. * @param array $columns the column data (name => value) to be updated. - * @param mixed $condition the conditions that will be put in the WHERE part. Please + * @param array|string $condition the conditions that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify conditions. * @param array $params the parameters to be bound to the query. */ @@ -177,7 +177,7 @@ class Migration extends \yii\base\Component /** * Creates and executes a DELETE SQL statement. * @param string $table the table where the data will be deleted from. - * @param mixed $condition the conditions that will be put in the WHERE part. Please + * @param array|string $condition the conditions that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify conditions. * @param array $params the parameters to be bound to the query. */ diff --git a/framework/yii/db/QueryBuilder.php b/framework/yii/db/QueryBuilder.php index dd59881..f67038c 100644 --- a/framework/yii/db/QueryBuilder.php +++ b/framework/yii/db/QueryBuilder.php @@ -163,7 +163,7 @@ class QueryBuilder extends \yii\base\Object * * @param string $table the table to be updated. * @param array $columns the column data (name => value) to be updated. - * @param mixed $condition the condition that will be put in the WHERE part. Please + * @param array|string $condition the condition that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify condition. * @param array $params the binding parameters that will be modified by this method * so that they can be bound to the DB command later. @@ -207,7 +207,7 @@ class QueryBuilder extends \yii\base\Object * The method will properly escape the table and column names. * * @param string $table the table where the data will be deleted from. - * @param mixed $condition the condition that will be put in the WHERE part. Please + * @param array|string $condition the condition that will be put in the WHERE part. Please * refer to [[Query::where()]] on how to specify condition. * @param array $params the binding parameters that will be modified by this method * so that they can be bound to the DB command later. @@ -461,7 +461,7 @@ class QueryBuilder extends \yii\base\Object * The sequence will be reset such that the primary key of the next new row inserted * will have the specified value or 1. * @param string $table the name of the table whose primary key sequence will be reset - * @param mixed $value the value for the primary key of the next new row inserted. If this is not set, + * @param array|string $value the value for the primary key of the next new row inserted. If this is not set, * the next new row's primary key will have a value 1. * @return string the SQL statement for resetting sequence * @throws NotSupportedException if this is not supported by the underlying DBMS diff --git a/framework/yii/helpers/ArrayHelperBase.php b/framework/yii/helpers/ArrayHelperBase.php index 2492246..59129de 100644 --- a/framework/yii/helpers/ArrayHelperBase.php +++ b/framework/yii/helpers/ArrayHelperBase.php @@ -143,7 +143,7 @@ class ArrayHelperBase * or an anonymous function returning the value. The anonymous function signature should be: * `function($array, $defaultValue)`. * @param mixed $default the default value to be returned if the specified key does not exist - * @return mixed the value of the + * @return mixed the value of the element if found, default value otherwise */ public static function getValue($array, $key, $default = null) { diff --git a/framework/yii/helpers/ConsoleBase.php b/framework/yii/helpers/ConsoleBase.php index 3593e74..a985291 100644 --- a/framework/yii/helpers/ConsoleBase.php +++ b/framework/yii/helpers/ConsoleBase.php @@ -665,8 +665,8 @@ class ConsoleBase /** * Prints text to STDOUT appended with a carriage return (PHP_EOL). * - * @param string $string - * @return mixed Number of bytes printed or bool false on error + * @param string $string the text to print + * @return integer|boolean number of bytes printed or false on error. */ public static function output($string = null) { @@ -676,8 +676,8 @@ class ConsoleBase /** * Prints text to STDERR appended with a carriage return (PHP_EOL). * - * @param string $string - * @return mixed Number of bytes printed or false on error + * @param string $string the text to print + * @return integer|boolean number of bytes printed or false on error. */ public static function error($string = null) { diff --git a/framework/yii/validators/FileValidator.php b/framework/yii/validators/FileValidator.php index 4487eee..fbd432d 100644 --- a/framework/yii/validators/FileValidator.php +++ b/framework/yii/validators/FileValidator.php @@ -21,7 +21,7 @@ use yii\web\UploadedFile; class FileValidator extends Validator { /** - * @var mixed a list of file name extensions that are allowed to be uploaded. + * @var array|string a list of file name extensions that are allowed to be uploaded. * This can be either an array or a string consisting of file extension names * separated by space or comma (e.g. "gif, jpg"). * Extension names are case-insensitive. Defaults to null, meaning all file name