Commit c582e589 by Carsten Brandt

added note about differing property types

parent ca69ef09
......@@ -253,8 +253,12 @@ class PhpDocController extends Controller
foreach ($props as $propName => &$prop) {
$docline = ' * @';
$docline .= 'property'; // Do not use property-read and property-write as few IDEs support complex syntax.
$note = '';
if (isset($prop['get']) && isset($prop['set'])) {
$note = '';
if ($prop['get']['type'] != $prop['set']['type']) {
$note = ' Note that the type of this property differs in getter and setter.'
. ' See [[get'.ucfirst($propName).'()]] and [[set'.ucfirst($propName).'()]] for details.';
}
} elseif (isset($prop['get'])) {
$note = ' This property is read-only.';
// $docline .= '-read';
......
......@@ -53,8 +53,9 @@ use yii\base\InvalidConfigException;
* each server, such as `persistent`, `weight`, `timeout`. Please see [[MemCacheServer]] for available options.
*
* @property \Memcache|\Memcached $memcache The memcache (or memcached) object used by this cache component.
* @property array $servers List of memcache server configurations. Each element must be an array
* with the following keys: host, port, persistent, weight, timeout, retryInterval, status.
* This property is read-only.
* @property MemCacheServer[] $servers List of memcache server configurations. Note that the type of this
* property differs in getter and setter. See [[getServers()]] and [[setServers()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......
......@@ -28,7 +28,8 @@ use yii\console\Controller;
* Note: by default this command relies on an external tools to perform actual files compression,
* check [[jsCompressor]] and [[cssCompressor]] for more details.
*
* @property \yii\web\AssetManager $assetManager Asset manager instance.
* @property \yii\web\AssetManager $assetManager Asset manager instance. Note that the type of this property
* differs in getter and setter. See [[getAssetManager()]] and [[setAssetManager()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......
......@@ -17,9 +17,11 @@ use yii\base\InvalidParamException;
* It implements the [[getPagination()]] and [[getSort()]] methods as specified by the [[IDataProvider]] interface.
*
* @property integer $count The number of data models in the current page. This property is read-only.
* @property Pagination $pagination The pagination object. If this is false, it means the pagination is
* disabled.
* @property Sort $sort The sorting object. If this is false, it means the sorting is disabled.
* @property Pagination|boolean $pagination The pagination object. If this is false, it means the pagination
* is disabled. Note that the type of this property differs in getter and setter. See [[getPagination()]] and
* [[setPagination()]] for details.
* @property Sort|boolean $sort The sorting object. If this is false, it means that sorting is disabled. Note
* that the type of this property differs in getter and setter. See [[getSort()]] and [[setSort()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......@@ -37,7 +39,7 @@ abstract class DataProvider extends Component implements IDataProvider
private $_pagination;
/**
* @return Pagination the pagination object. If this is false, it means the pagination is disabled.
* @return Pagination|boolean the pagination object. If this is false, it means the pagination is disabled.
*/
public function getPagination()
{
......@@ -80,7 +82,7 @@ abstract class DataProvider extends Component implements IDataProvider
}
/**
* @return Sort the sorting object. If this is false, it means the sorting is disabled.
* @return Sort|boolean the sorting object. If this is false, it means the sorting is disabled.
*/
public function getSort()
{
......
......@@ -44,7 +44,8 @@ use yii\caching\Cache;
*
* To build SELECT SQL statements, please use [[QueryBuilder]] instead.
*
* @property string $rawSql The raw SQL. This property is read-only.
* @property string $rawSql The raw SQL with parameter values inserted into the corresponding placeholders in
* [[sql]]. This property is read-only.
* @property string $sql The SQL statement to be executed.
*
* @author Qiang Xue <qiang.xue@gmail.com>
......@@ -103,7 +104,7 @@ class Command extends \yii\base\Component
* Returns the raw SQL by inserting parameter values into the corresponding placeholders in [[sql]].
* Note that the return value of this method should mainly be used for logging purpose.
* It is likely that this method returns an invalid SQL due to improper replacement of parameter placeholders.
* @return string the raw SQL
* @return string the raw SQL with parameter values inserted into the corresponding placeholders in [[sql]].
*/
public function getRawSql()
{
......
......@@ -23,7 +23,8 @@ use yii\base\InvalidConfigException;
* may specify [[except]] to exclude messages of certain categories.
*
* @property integer $levels The message levels that this target is interested in. This is a bitmap of level
* values. Defaults to 0, meaning all available levels.
* values. Defaults to 0, meaning all available levels. Note that the type of this property differs in getter
* and setter. See [[getLevels()]] and [[setLevels()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......
......@@ -16,7 +16,8 @@ use yii\helpers\FileHelper;
/**
* AssetManager manages asset bundles and asset publishing.
*
* @property IAssetConverter $converter The asset converter.
* @property IAssetConverter $converter The asset converter. Note that the type of this property differs in
* getter and setter. See [[getConverter()]] and [[setConverter()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......
......@@ -25,7 +25,8 @@ use yii\base\InvalidConfigException;
* @property Identity $identity The identity object associated with the currently logged user. Null is
* returned if the user is not logged in (not authenticated).
* @property boolean $isGuest Whether the current user is a guest. This property is read-only.
* @property string $returnUrl The URL that the user should be redirected to after login.
* @property string $returnUrl The URL that the user should be redirected to after login. Note that the type
* of this property differs in getter and setter. See [[getReturnUrl()]] and [[setReturnUrl()]] for details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......
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