Commit d1f18e43 by Paul Klimov

Merge branch 'master' of github.com:yiisoft/yii2

parents 5a584c0b 913eb622
...@@ -278,11 +278,35 @@ class PhpDocController extends Controller ...@@ -278,11 +278,35 @@ class PhpDocController extends Controller
. ' See [[get'.ucfirst($propName).'()]] and [[set'.ucfirst($propName).'()]] for details.'; . ' See [[get'.ucfirst($propName).'()]] and [[set'.ucfirst($propName).'()]] for details.';
} }
} elseif (isset($prop['get'])) { } elseif (isset($prop['get'])) {
$note = ' This property is read-only.'; // check if parent class has setter defined
// $docline .= '-read'; $c = $className;
$parentSetter = false;
while($parent = get_parent_class($c)) {
if (method_exists($parent, 'set' . ucfirst($propName))) {
$parentSetter = true;
break;
}
$c = $parent;
}
if (!$parentSetter) {
$note = ' This property is read-only.';
// $docline .= '-read';
}
} elseif (isset($prop['set'])) { } elseif (isset($prop['set'])) {
$note = ' This property is write-only.'; // check if parent class has getter defined
// $docline .= '-write'; $c = $className;
$parentGetter = false;
while($parent = get_parent_class($c)) {
if (method_exists($parent, 'set' . ucfirst($propName))) {
$parentGetter = true;
break;
}
$c = $parent;
}
if (!$parentGetter) {
$note = ' This property is write-only.';
// $docline .= '-write';
}
} else { } else {
continue; continue;
} }
......
...@@ -15,6 +15,7 @@ use yii\web\HttpException; ...@@ -15,6 +15,7 @@ use yii\web\HttpException;
* Application is the base class for all application classes. * Application is the base class for all application classes.
* *
* @property \yii\rbac\Manager $authManager The auth manager for this application. This property is read-only. * @property \yii\rbac\Manager $authManager The auth manager for this application. This property is read-only.
* @property string $basePath The root directory of the application.
* @property \yii\caching\Cache $cache The cache application component. Null if the component is not enabled. * @property \yii\caching\Cache $cache The cache application component. Null if the component is not enabled.
* This property is read-only. * This property is read-only.
* @property \yii\db\Connection $db The database connection. This property is read-only. * @property \yii\db\Connection $db The database connection. This property is read-only.
...@@ -261,6 +262,7 @@ abstract class Application extends Module ...@@ -261,6 +262,7 @@ abstract class Application extends Module
* Sets the root directory of the applicaition and the @app alias. * Sets the root directory of the applicaition and the @app alias.
* This method can only be invoked at the beginning of the constructor. * This method can only be invoked at the beginning of the constructor.
* @param string $path the root directory of the application. * @param string $path the root directory of the application.
* @property string the root directory of the application.
* @throws InvalidParamException if the directory does not exist. * @throws InvalidParamException if the directory does not exist.
*/ */
public function setBasePath($path) public function setBasePath($path)
......
...@@ -29,6 +29,8 @@ use yii\helpers\Inflector; ...@@ -29,6 +29,8 @@ use yii\helpers\Inflector;
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is * @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be * returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be
* returned if the key value is null). This property is read-only. * returned if the key value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if * @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if * the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). This property is read-only. * the key value is null). This property is read-only.
......
...@@ -20,7 +20,8 @@ use yii\web\View; ...@@ -20,7 +20,8 @@ use yii\web\View;
* *
* @see BaseMessage * @see BaseMessage
* *
* @property View|array $view view instance or its array configuration. * @property View $view View instance. Note that the type of this property differs in getter and setter. See
* [[getView()]] and [[setView()]] for details.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
......
...@@ -18,7 +18,7 @@ use Yii; ...@@ -18,7 +18,7 @@ use Yii;
* *
* @see BaseMailer * @see BaseMailer
* *
* @property BaseMailer $mailer mailer component instance. This property is read-only. * @property MailerInterface $mailer The mailer component. This property is read-only.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
......
...@@ -14,6 +14,8 @@ use yii\helpers\Html; ...@@ -14,6 +14,8 @@ use yii\helpers\Html;
/** /**
* Controller is the base class of web controllers. * Controller is the base class of web controllers.
* *
* @property string $canonicalUrl This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
......
...@@ -31,6 +31,8 @@ use yii\helpers\Security; ...@@ -31,6 +31,8 @@ use yii\helpers\Security;
* @property string $csrfToken The random token for CSRF validation. This property is read-only. * @property string $csrfToken The random token for CSRF validation. This property is read-only.
* @property string $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is returned * @property string $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is returned
* if no such header is sent. This property is read-only. * if no such header is sent. This property is read-only.
* @property array $delete The DELETE request parameter values. This property is read-only.
* @property array $get The GET request parameter values. This property is read-only.
* @property string $hostInfo Schema and hostname part (with port number if needed) of the request URL (e.g. * @property string $hostInfo Schema and hostname part (with port number if needed) of the request URL (e.g.
* `http://www.yiiframework.com`). * `http://www.yiiframework.com`).
* @property boolean $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only. * @property boolean $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only.
...@@ -47,11 +49,14 @@ use yii\helpers\Security; ...@@ -47,11 +49,14 @@ use yii\helpers\Security;
* read-only. * read-only.
* @property string $method Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. The value returned is * @property string $method Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. The value returned is
* turned into upper case. This property is read-only. * turned into upper case. This property is read-only.
* @property array $patch The PATCH request parameter values. This property is read-only.
* @property string $pathInfo Part of the request URL that is after the entry script and before the question * @property string $pathInfo Part of the request URL that is after the entry script and before the question
* mark. Note, the returned path info is already URL-decoded. * mark. Note, the returned path info is already URL-decoded.
* @property integer $port Port number for insecure requests. * @property integer $port Port number for insecure requests.
* @property array $post The POST request parameter values. This property is read-only.
* @property string $preferredLanguage The language that the application should use. Null is returned if both * @property string $preferredLanguage The language that the application should use. Null is returned if both
* [[getAcceptedLanguages()]] and `$languages` are empty. This property is read-only. * [[getAcceptedLanguages()]] and `$languages` are empty. This property is read-only.
* @property array $put The PUT request parameter values. This property is read-only.
* @property string $queryString Part of the request URL that is after the question mark. This property is * @property string $queryString Part of the request URL that is after the question mark. This property is
* read-only. * read-only.
* @property string $rawBody The request body. This property is read-only. * @property string $rawBody The request body. This property is read-only.
...@@ -304,12 +309,22 @@ class Request extends \yii\base\Request ...@@ -304,12 +309,22 @@ class Request extends \yii\base\Request
} }
/** /**
* Returns the GET request parameter values.
* @return array the GET request parameter values
*/
public function getGet()
{
return $_GET;
}
/**
* Returns the named POST parameter value. * Returns the named POST parameter value.
* If the POST parameter does not exist, the second parameter to this method will be returned. * If the POST parameter does not exist, the second parameter to this method will be returned.
* @param string $name the POST parameter name. If not specified, whole $_POST is returned. * @param string $name the POST parameter name. If not specified, whole $_POST is returned.
* @param mixed $defaultValue the default parameter value if the POST parameter does not exist. * @param mixed $defaultValue the default parameter value if the POST parameter does not exist.
* @property array the POST request parameter values
* @return mixed the POST parameter value * @return mixed the POST parameter value
* @see getParam * @see get
*/ */
public function getPost($name = null, $defaultValue = null) public function getPost($name = null, $defaultValue = null)
{ {
...@@ -323,6 +338,7 @@ class Request extends \yii\base\Request ...@@ -323,6 +338,7 @@ class Request extends \yii\base\Request
* Returns the named DELETE parameter value. * Returns the named DELETE parameter value.
* @param string $name the DELETE parameter name. If not specified, an array of DELETE parameters is returned. * @param string $name the DELETE parameter name. If not specified, an array of DELETE parameters is returned.
* @param mixed $defaultValue the default parameter value if the DELETE parameter does not exist. * @param mixed $defaultValue the default parameter value if the DELETE parameter does not exist.
* @property array the DELETE request parameter values
* @return mixed the DELETE parameter value * @return mixed the DELETE parameter value
*/ */
public function getDelete($name = null, $defaultValue = null) public function getDelete($name = null, $defaultValue = null)
...@@ -337,6 +353,7 @@ class Request extends \yii\base\Request ...@@ -337,6 +353,7 @@ class Request extends \yii\base\Request
* Returns the named PUT parameter value. * Returns the named PUT parameter value.
* @param string $name the PUT parameter name. If not specified, an array of PUT parameters is returned. * @param string $name the PUT parameter name. If not specified, an array of PUT parameters is returned.
* @param mixed $defaultValue the default parameter value if the PUT parameter does not exist. * @param mixed $defaultValue the default parameter value if the PUT parameter does not exist.
* @property array the PUT request parameter values
* @return mixed the PUT parameter value * @return mixed the PUT parameter value
*/ */
public function getPut($name = null, $defaultValue = null) public function getPut($name = null, $defaultValue = null)
...@@ -351,6 +368,7 @@ class Request extends \yii\base\Request ...@@ -351,6 +368,7 @@ class Request extends \yii\base\Request
* Returns the named PATCH parameter value. * Returns the named PATCH parameter value.
* @param string $name the PATCH parameter name. If not specified, an array of PATCH parameters is returned. * @param string $name the PATCH parameter name. If not specified, an array of PATCH parameters is returned.
* @param mixed $defaultValue the default parameter value if the PATCH parameter does not exist. * @param mixed $defaultValue the default parameter value if the PATCH parameter does not exist.
* @property array the PATCH request parameter values
* @return mixed the PATCH parameter value * @return mixed the PATCH parameter value
*/ */
public function getPatch($name = null, $defaultValue = null) public function getPatch($name = null, $defaultValue = null)
......
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