From 40cb98bb0206f942e799a7b52257c741b10cc124 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 11 Mar 2014 16:21:25 +0100 Subject: [PATCH] updated `@property` annotations --- extensions/apidoc/commands/ApiController.php | 7 ++++--- extensions/apidoc/commands/GuideController.php | 2 ++ extensions/apidoc/templates/html/GuideRenderer.php | 2 ++ extensions/bootstrap/BootstrapAsset.php | 2 ++ extensions/bootstrap/BootstrapPluginAsset.php | 1 + extensions/bootstrap/BootstrapThemeAsset.php | 2 +- extensions/gii/generators/extension/Generator.php | 4 ++++ framework/base/Component.php | 1 - framework/base/Model.php | 5 +++-- framework/base/Module.php | 4 ++-- framework/base/Object.php | 1 - framework/base/View.php | 3 +++ framework/data/Pagination.php | 3 +++ framework/web/Request.php | 9 +++++++-- framework/web/Session.php | 1 + framework/web/User.php | 4 ++-- 16 files changed, 37 insertions(+), 14 deletions(-) diff --git a/extensions/apidoc/commands/ApiController.php b/extensions/apidoc/commands/ApiController.php index 6922777289..aeeea44356 100644 --- a/extensions/apidoc/commands/ApiController.php +++ b/extensions/apidoc/commands/ApiController.php @@ -7,7 +7,6 @@ namespace yii\apidoc\commands; - use yii\apidoc\components\BaseController; use yii\apidoc\models\Context; use yii\apidoc\renderers\ApiRenderer; @@ -17,8 +16,10 @@ use yii\helpers\Console; use yii\helpers\FileHelper; /** - * Generate class API documentation + * Generate class API documentation. * + * @author Carsten Brandt + * @since 2.0 */ class ApiController extends BaseController { @@ -158,4 +159,4 @@ class ApiController extends BaseController { return array_merge(parent::options($id), ['template', 'guide']); } -} +} diff --git a/extensions/apidoc/commands/GuideController.php b/extensions/apidoc/commands/GuideController.php index 1f9ac83066..83b68a9076 100644 --- a/extensions/apidoc/commands/GuideController.php +++ b/extensions/apidoc/commands/GuideController.php @@ -18,6 +18,8 @@ use Yii; * This command can render documentation stored as markdown files such as the yii guide * or your own applications documentation setup. * + * @author Carsten Brandt + * @since 2.0 */ class GuideController extends BaseController { diff --git a/extensions/apidoc/templates/html/GuideRenderer.php b/extensions/apidoc/templates/html/GuideRenderer.php index 2ac7fd1ddb..e6dd4c9889 100644 --- a/extensions/apidoc/templates/html/GuideRenderer.php +++ b/extensions/apidoc/templates/html/GuideRenderer.php @@ -17,6 +17,8 @@ use yii\web\AssetManager; use yii\web\View; /** + * + * @property View $view The view instance. This property is read-only. * * @author Carsten Brandt * @since 2.0 diff --git a/extensions/bootstrap/BootstrapAsset.php b/extensions/bootstrap/BootstrapAsset.php index 27dabc09d3..93f7728e38 100644 --- a/extensions/bootstrap/BootstrapAsset.php +++ b/extensions/bootstrap/BootstrapAsset.php @@ -10,6 +10,8 @@ namespace yii\bootstrap; use yii\web\AssetBundle; /** + * Asset bundle for the Twitter bootstrap css files. + * * @author Qiang Xue * @since 2.0 */ diff --git a/extensions/bootstrap/BootstrapPluginAsset.php b/extensions/bootstrap/BootstrapPluginAsset.php index 35bf18a928..c451ff4f43 100644 --- a/extensions/bootstrap/BootstrapPluginAsset.php +++ b/extensions/bootstrap/BootstrapPluginAsset.php @@ -10,6 +10,7 @@ namespace yii\bootstrap; use yii\web\AssetBundle; /** + * Asset bundle for the Twitter bootstrap javascript files. * * @author Qiang Xue * @since 2.0 diff --git a/extensions/bootstrap/BootstrapThemeAsset.php b/extensions/bootstrap/BootstrapThemeAsset.php index f15a0fb0c9..fa424f934a 100644 --- a/extensions/bootstrap/BootstrapThemeAsset.php +++ b/extensions/bootstrap/BootstrapThemeAsset.php @@ -10,7 +10,7 @@ namespace yii\bootstrap; use yii\web\AssetBundle; /** - * Bootstrap 2 theme for Bootstrap 3 + * Bootstrap 2 theme for Bootstrap 3. * * @author Alexander Makarov * @since 2.0 diff --git a/extensions/gii/generators/extension/Generator.php b/extensions/gii/generators/extension/Generator.php index 094d476990..be47fbc9a1 100644 --- a/extensions/gii/generators/extension/Generator.php +++ b/extensions/gii/generators/extension/Generator.php @@ -13,6 +13,10 @@ use yii\gii\CodeFile; /** * This generator will generate the skeleton files needed by an extension. * + * @property string $keywordsArrayJson A json encoded array with the given keywords. This property is + * read-only. + * @property boolean $outputPath The directory that contains the module class. This property is read-only. + * * @author Tobias Munk * @since 2.0 */ diff --git a/framework/base/Component.php b/framework/base/Component.php index a5c6d46047..596eecaaf8 100644 --- a/framework/base/Component.php +++ b/framework/base/Component.php @@ -69,7 +69,6 @@ use Yii; * }, $data); * ~~~ * - * * A behavior is an instance of [[Behavior]] or its child class. A component can be attached with one or multiple * behaviors. When a behavior is attached to a component, its public properties and methods can be accessed via the * component directly, as if the component owns those properties and methods. diff --git a/framework/base/Model.php b/framework/base/Model.php index 3a5a64f671..681db48419 100644 --- a/framework/base/Model.php +++ b/framework/base/Model.php @@ -41,8 +41,9 @@ use yii\validators\Validator; * @property array $attributes Attribute values (name => value). * @property array $errors An array of errors for all attributes. Empty array is returned if no error. The * result is a two-dimensional array. See [[getErrors()]] for detailed description. This property is read-only. - * @property array $firstErrors The first errors. An empty array will be returned if there is no error. This - * property is read-only. + * @property array $firstErrors The first errors. The array keys are the attribute names, and the array values + * are the corresponding error messages. An empty array will be returned if there is no error. This property is + * read-only. * @property ArrayIterator $iterator An iterator for traversing the items in the list. This property is * read-only. * @property string $scenario The scenario that this model is in. Defaults to [[SCENARIO_DEFAULT]]. diff --git a/framework/base/Module.php b/framework/base/Module.php index 95a2ccb899..eb7ce90a05 100644 --- a/framework/base/Module.php +++ b/framework/base/Module.php @@ -25,8 +25,8 @@ use Yii; * This property is write-only. * @property string $basePath The root directory of the module. * @property array $components The components (indexed by their IDs). - * @property string $controllerPath The directory that contains the controller classes according to [[controllerNamespace]]. - * This property is read-only. + * @property string $controllerPath The directory that contains the controller classes. This property is + * read-only. * @property string $layoutPath The root directory of layout files. Defaults to "[[viewPath]]/layouts". * @property array $modules The modules (indexed by their IDs). * @property string $uniqueId The unique ID of the module. This property is read-only. diff --git a/framework/base/Object.php b/framework/base/Object.php index 8d3814fdc8..8f20136c24 100644 --- a/framework/base/Object.php +++ b/framework/base/Object.php @@ -46,7 +46,6 @@ use Yii; * * One can call [[hasProperty()]], [[canGetProperty()]] and/or [[canSetProperty()]] to check the existence of a property. * - * * Besides the property feature, Object also introduces an important object initialization life cycle. In particular, * creating an new instance of Object or its derived class will involve the following life cycles sequentially: * diff --git a/framework/base/View.php b/framework/base/View.php index b9c61ad94a..6732566027 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -18,6 +18,9 @@ use yii\widgets\FragmentCache; * * View provides a set of methods (e.g. [[render()]]) for rendering purpose. * + * @property string|boolean $viewFile The view file currently being rendered. False if no view file is being + * rendered. This property is read-only. + * * @author Qiang Xue * @since 2.0 */ diff --git a/framework/data/Pagination.php b/framework/data/Pagination.php index cb3f263f4a..a5ef86ea20 100644 --- a/framework/data/Pagination.php +++ b/framework/data/Pagination.php @@ -59,10 +59,13 @@ use yii\web\Request; * @property integer $limit The limit of the data. This may be used to set the LIMIT value for a SQL statement * for fetching the current page of data. Note that if the page size is infinite, a value -1 will be returned. * This property is read-only. + * @property array $links The links for navigational purpose. The array keys specify the purpose of the links + * (e.g. [[LINK_FIRST]]), and the array values are the corresponding URLs. This property is read-only. * @property integer $offset The offset of the data. This may be used to set the OFFSET value for a SQL * statement for fetching the current page of data. This property is read-only. * @property integer $page The zero-based current page number. * @property integer $pageCount Number of pages. This property is read-only. + * @property integer $pageSize The number of items per page. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/Request.php b/framework/web/Request.php index 4b7c2abb52..e772ba2346 100644 --- a/framework/web/Request.php +++ b/framework/web/Request.php @@ -23,10 +23,15 @@ use yii\helpers\StringHelper; * You can access that instance via `Yii::$app->request`. * * @property string $absoluteUrl The currently requested absolute URL. This property is read-only. - * @property array $acceptableContentTypes The content types ordered by the preference level. The first - * element represents the most preferred content type. + * @property array $acceptableContentTypes The content types ordered by the quality score. Types with the + * highest scores will be returned first. The array keys are the content types, while the array values are the + * corresponding quality score and other parameters as given in the header. * @property array $acceptableLanguages The languages ordered by the preference level. The first element * represents the most preferred language. + * @property string $authPassword The password sent via HTTP authentication, null if the password is not + * given. This property is read-only. + * @property string $authUser The username sent via HTTP authentication, null if the username is not given. + * This property is read-only. * @property string $baseUrl The relative URL for the application. * @property array $bodyParams The request parameters given in the request body. * @property string $contentType Request content-type. Null is returned if this information is not available. diff --git a/framework/web/Session.php b/framework/web/Session.php index df94768db9..d08847f4c1 100644 --- a/framework/web/Session.php +++ b/framework/web/Session.php @@ -54,6 +54,7 @@ use yii\base\InvalidParamException; * be overwritten by this method. This property is write-only. * @property float $gCProbability The probability (percentage) that the GC (garbage collection) process is * started on every session initialization, defaults to 1 meaning 1% chance. + * @property boolean $hasSessionId Whether the current request has sent the session ID. * @property string $id The current session ID. * @property boolean $isActive Whether the session has started. This property is read-only. * @property SessionIterator $iterator An iterator for traversing the session variables. This property is diff --git a/framework/web/User.php b/framework/web/User.php index a0b332a394..cc0e5a7fac 100644 --- a/framework/web/User.php +++ b/framework/web/User.php @@ -46,8 +46,8 @@ use yii\base\InvalidConfigException; * * @property string|integer $id The unique identifier for the user. If null, it means the user is a guest. * This property is read-only. - * @property IdentityInterface $identity The identity object associated with the currently logged user. Null - * is returned if the user is not logged in (not authenticated). + * @property IdentityInterface $identity The identity object associated with the currently logged-in 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. Note that the type * of this property differs in getter and setter. See [[getReturnUrl()]] and [[setReturnUrl()]] for details.