From ccb14ff6671279f184906024144544ce3b732393 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 10 Nov 2020 13:58:35 +0300 Subject: [PATCH] release version 2.0.39 --- framework/BaseYii.php | 2 +- framework/CHANGELOG.md | 14 ++-- framework/base/Action.php | 2 +- framework/base/Application.php | 44 ++++++----- framework/base/Component.php | 3 +- framework/base/Controller.php | 10 +-- framework/base/ErrorHandler.php | 4 +- framework/base/Model.php | 17 ++-- framework/base/Module.php | 12 +-- framework/base/View.php | 2 +- framework/base/Widget.php | 7 +- framework/caching/MemCache.php | 6 +- framework/captcha/CaptchaAction.php | 2 +- framework/console/Application.php | 7 +- framework/console/Controller.php | 10 +-- .../console/controllers/AssetController.php | 2 +- .../console/controllers/HelpController.php | 2 +- framework/console/widgets/Table.php | 4 +- framework/data/BaseDataProvider.php | 6 +- framework/data/DataFilter.php | 7 +- framework/data/Pagination.php | 16 ++-- framework/data/Sort.php | 6 +- framework/db/BaseActiveRecord.php | 16 ++-- framework/db/Connection.php | 30 +++---- framework/db/DataReader.php | 8 +- framework/db/Query.php | 2 +- framework/db/QueryBuilder.php | 8 +- framework/db/Schema.php | 21 ++--- framework/db/SqlToken.php | 6 +- framework/db/TableSchema.php | 2 +- framework/db/Transaction.php | 12 +-- framework/db/mssql/ColumnSchema.php | 1 + framework/db/oci/Schema.php | 4 +- framework/db/sqlite/Schema.php | 6 +- framework/di/Container.php | 10 +-- framework/i18n/I18N.php | 2 +- framework/i18n/Locale.php | 2 +- framework/i18n/MessageFormatter.php | 4 +- framework/log/Dispatcher.php | 2 +- framework/log/Logger.php | 12 +-- framework/log/Target.php | 4 +- framework/mail/BaseMailer.php | 2 +- framework/rbac/BaseManager.php | 6 +- framework/test/ActiveFixture.php | 2 +- framework/validators/FileValidator.php | 2 +- framework/validators/Validator.php | 4 +- framework/web/Application.php | 11 +-- framework/web/AssetManager.php | 2 +- framework/web/CacheSession.php | 2 +- framework/web/CompositeUrlRule.php | 4 +- framework/web/CookieCollection.php | 6 +- framework/web/HeaderCollection.php | 6 +- framework/web/MultiFieldSession.php | 2 +- framework/web/Request.php | 79 ++++++++++--------- framework/web/Response.php | 36 +++++---- framework/web/Session.php | 28 +++---- framework/web/UploadedFile.php | 8 +- framework/web/UrlRule.php | 4 +- framework/web/User.php | 8 +- framework/widgets/FragmentCache.php | 4 +- 60 files changed, 286 insertions(+), 267 deletions(-) diff --git a/framework/BaseYii.php b/framework/BaseYii.php index 00cb0dd69c9..7bcba8f17a4 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -93,7 +93,7 @@ class BaseYii */ public static function getVersion() { - return '2.0.39-dev'; + return '2.0.39'; } /** diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 6ff182b8f54..3377320350a 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -1,23 +1,23 @@ Yii Framework 2 Change Log ========================== -2.0.39 under development +2.0.39 November 10, 2020 ------------------------ -- Enh #18247: Add support for the 'session.use_strict_mode' ini directive in `yii\web\Session` (rhertogh) -- Bug #18263: Fix writing `\yii\caching\FileCache` files to the same directory when `keyPrefix` is set (githubjeka) +- Bug #16418: Fix `yii\data\Pagination::getLinks()` to return links to the first and the last pages regardless of the current page (ptz-nerf, bizley) +- Bug #16831: Fix console Table widget does not render correctly in combination with ANSI formatting (issidorov, cebe) - Bug #18160, #18192: Fix `registerFile` with set argument `depends` does not take `position` and `appendTimestamp` into account (baleeny) +- Bug #18263: Fix writing `\yii\caching\FileCache` files to the same directory when `keyPrefix` is set (githubjeka) +- Bug #18287: Fix for `OUTPUT INSERTED` and computed columns. Add flag to mark computed values in table schema (darkdef) - Bug #18290: Fix response with non-seekable streams (schmunk42) -- Bug #16418: Fix `yii\data\Pagination::getLinks()` to return links to the first and the last pages regardless of the current page (ptz-nerf, bizley) - Bug #18297: Replace usage of deprecated `ReflectionParameter::isArray()` method in PHP8 (baletskyi) - Bug #18303: Fix creating migration for column methods used after `defaultValues` (wsaid) -- Bug #18287: Fix for `OUTPUT INSERTED` and computed columns. Add flag to mark computed values in table schema (darkdef) - Bug #18308: Fix `\yii\base\Model::getErrorSummary()` reverse order (DrDeath72) - Bug #18313: Fix multipart form data parsing with double quotes (wsaid) - Bug #18317: Additional PHP 8 compatibility fixes (samdark, bizley) -- Bug #16831: Fix console Table widget does not render correctly in combination with ANSI formatting (issidorov, cebe) -- Enh #18304: Add support of constructor parameters with default values to DI container (vjik) +- Enh #18247: Add support for the 'session.use_strict_mode' ini directive in `yii\web\Session` (rhertogh) - Enh #18285: Enhanced DI container to allow passing parameters by name in a constructor (vjik) +- Enh #18304: Add support of constructor parameters with default values to DI container (vjik) - Enh #18351: Add option to change default timezone for parsing formats without time part in `yii\validators\DateValidator` (bizley) diff --git a/framework/base/Action.php b/framework/base/Action.php index bf6464e1c09..5a9413cf296 100644 --- a/framework/base/Action.php +++ b/framework/base/Action.php @@ -30,7 +30,7 @@ * * For more details and usage information on Action, see the [guide article on actions](guide:structure-controllers). * - * @property string $uniqueId The unique ID of this action among the whole application. This property is + * @property-read string $uniqueId The unique ID of this action among the whole application. This property is * read-only. * * @author Qiang Xue diff --git a/framework/base/Application.php b/framework/base/Application.php index d7771bf636f..94f4be11787 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -14,33 +14,39 @@ * * For more details and usage information on Application, see the [guide article on applications](guide:structure-applications). * - * @property \yii\web\AssetManager $assetManager The asset manager application component. This property is - * read-only. - * @property \yii\rbac\ManagerInterface $authManager The auth manager application component. Null is returned - * if auth manager is not configured. This property is read-only. + * @property-read \yii\web\AssetManager $assetManager The asset manager application component. This property + * is read-only. + * @property-read \yii\rbac\ManagerInterface $authManager The auth manager application component. Null is + * returned if auth manager is not configured. This property is read-only. * @property string $basePath The root directory of the application. - * @property \yii\caching\CacheInterface $cache The cache application component. Null if the component is not - * enabled. This property is read-only. - * @property array $container Values given in terms of name-value pairs. This property is write-only. - * @property \yii\db\Connection $db The database connection. This property is read-only. - * @property \yii\web\ErrorHandler|\yii\console\ErrorHandler $errorHandler The error handler application + * @property-read \yii\caching\CacheInterface $cache The cache application component. Null if the component is + * not enabled. This property is read-only. + * @property-write array $container Values given in terms of name-value pairs. This property is write-only. + * @property-read \yii\db\Connection $db The database connection. This property is read-only. + * @property-read \yii\web\ErrorHandler|\yii\console\ErrorHandler $errorHandler The error handler application * component. This property is read-only. - * @property \yii\i18n\Formatter $formatter The formatter application component. This property is read-only. - * @property \yii\i18n\I18N $i18n The internationalization application component. This property is read-only. - * @property \yii\log\Dispatcher $log The log dispatcher application component. This property is read-only. - * @property \yii\mail\MailerInterface $mailer The mailer application component. This property is read-only. - * @property \yii\web\Request|\yii\console\Request $request The request component. This property is read-only. - * @property \yii\web\Response|\yii\console\Response $response The response component. This property is + * @property-read \yii\i18n\Formatter $formatter The formatter application component. This property is + * read-only. + * @property-read \yii\i18n\I18N $i18n The internationalization application component. This property is + * read-only. + * @property-read \yii\log\Dispatcher $log The log dispatcher application component. This property is + * read-only. + * @property-read \yii\mail\MailerInterface $mailer The mailer application component. This property is + * read-only. + * @property-read \yii\web\Request|\yii\console\Request $request The request component. This property is + * read-only. + * @property-read \yii\web\Response|\yii\console\Response $response The response component. This property is * read-only. * @property string $runtimePath The directory that stores runtime files. Defaults to the "runtime" * subdirectory under [[basePath]]. - * @property \yii\base\Security $security The security application component. This property is read-only. + * @property-read \yii\base\Security $security The security application component. This property is read-only. * @property string $timeZone The time zone used by this application. - * @property string $uniqueId The unique ID of the module. This property is read-only. - * @property \yii\web\UrlManager $urlManager The URL manager for this application. This property is read-only. + * @property-read string $uniqueId The unique ID of the module. This property is read-only. + * @property-read \yii\web\UrlManager $urlManager The URL manager for this application. This property is + * read-only. * @property string $vendorPath The directory that stores vendor files. Defaults to "vendor" directory under * [[basePath]]. - * @property View|\yii\web\View $view The view application component that is used to render various view + * @property-read View|\yii\web\View $view The view application component that is used to render various view * files. This property is read-only. * * @author Qiang Xue diff --git a/framework/base/Component.php b/framework/base/Component.php index 89bd36a29fc..65516e281fc 100644 --- a/framework/base/Component.php +++ b/framework/base/Component.php @@ -93,7 +93,8 @@ * * For more details and usage information on Component, see the [guide article on components](guide:concept-components). * - * @property Behavior[] $behaviors List of behaviors attached to this component. This property is read-only. + * @property-read Behavior[] $behaviors List of behaviors attached to this component. This property is + * read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/base/Controller.php b/framework/base/Controller.php index 79e4dc1efef..e15b091eb0f 100644 --- a/framework/base/Controller.php +++ b/framework/base/Controller.php @@ -16,12 +16,12 @@ * * For more details and usage information on Controller, see the [guide article on controllers](guide:structure-controllers). * - * @property Module[] $modules All ancestor modules that this controller is located within. This property is - * read-only. - * @property string $route The route (module ID, controller ID and action ID) of the current request. This + * @property-read Module[] $modules All ancestor modules that this controller is located within. This property + * is read-only. + * @property-read string $route The route (module ID, controller ID and action ID) of the current request. + * This property is read-only. + * @property-read string $uniqueId The controller ID that is prefixed with the module ID (if any). This * property is read-only. - * @property string $uniqueId The controller ID that is prefixed with the module ID (if any). This property is - * read-only. * @property View|\yii\web\View $view The view object that can be used to render views or view files. * @property string $viewPath The directory containing the view files for this controller. * diff --git a/framework/base/ErrorHandler.php b/framework/base/ErrorHandler.php index 1a3afa1da19..8d98dafe789 100644 --- a/framework/base/ErrorHandler.php +++ b/framework/base/ErrorHandler.php @@ -345,7 +345,7 @@ public static function convertExceptionToError($exception) /** * Converts an exception into a simple string. - * @param \Exception|\Error|\Throwable $exception the exception being converted + * @param \Exception|\Error|\Throwable $exception the exception being converted * @return string the string representation of the exception. */ public static function convertExceptionToString($exception) @@ -363,7 +363,7 @@ public static function convertExceptionToString($exception) /** * Converts an exception into a string that has verbose information about the exception and its trace. - * @param \Exception|\Error|\Throwable $exception the exception being converted + * @param \Exception|\Error|\Throwable $exception the exception being converted * @return string the string representation of the exception. * * @since 2.0.14 diff --git a/framework/base/Model.php b/framework/base/Model.php index 25433ce46b1..085ec1a992b 100644 --- a/framework/base/Model.php +++ b/framework/base/Model.php @@ -37,19 +37,20 @@ * * For more details and usage information on Model, see the [guide article on models](guide:structure-models). * - * @property \yii\validators\Validator[] $activeValidators The validators applicable to the current + * @property-read \yii\validators\Validator[] $activeValidators The validators applicable to the current * [[scenario]]. This property is read-only. * @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. 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 + * @property-read 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 ArrayIterator $iterator An iterator for traversing the items in the list. This property is + * @property-read 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-read 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]]. - * @property ArrayObject|\yii\validators\Validator[] $validators All the validators declared in the model. - * This property is read-only. + * @property-read ArrayObject|\yii\validators\Validator[] $validators All the validators declared in the + * model. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/base/Module.php b/framework/base/Module.php index d5954162cbe..d8577d482ed 100644 --- a/framework/base/Module.php +++ b/framework/base/Module.php @@ -23,17 +23,17 @@ * * For more details and usage information on Module, see the [guide article on modules](guide:structure-modules). * - * @property array $aliases List of path aliases to be defined. The array keys are alias names (must start - * with `@`) and the array values are the corresponding paths or aliases. See [[setAliases()]] for an example. - * This property is write-only. + * @property-write array $aliases List of path aliases to be defined. The array keys are alias names (must + * start with `@`) and the array values are the corresponding paths or aliases. See [[setAliases()]] for an + * example. This property is write-only. * @property string $basePath The root directory of the module. - * @property string $controllerPath The directory that contains the controller classes. This property is + * @property-read 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. + * @property-read string $uniqueId The unique ID of the module. This property is read-only. * @property string $version The version of this module. Note that the type of this property differs in getter - * and setter. See [[getVersion()]] and [[setVersion()]] for details. + * and setter. See [[getVersion()]] and [[setVersion()]] for details. * @property string $viewPath The root directory of view files. Defaults to "[[basePath]]/views". * * @author Qiang Xue diff --git a/framework/base/View.php b/framework/base/View.php index d9584a3f176..d5b64c668c1 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -20,7 +20,7 @@ * * For more details and usage information on View, see the [guide article on views](guide:structure-views). * - * @property string|bool $viewFile The view file currently being rendered. False if no view file is being + * @property-read string|bool $viewFile The view file currently being rendered. False if no view file is being * rendered. This property is read-only. * * @author Qiang Xue diff --git a/framework/base/Widget.php b/framework/base/Widget.php index c9850cd8ce9..ab27f028f2f 100644 --- a/framework/base/Widget.php +++ b/framework/base/Widget.php @@ -15,10 +15,11 @@ * * For more details and usage information on Widget, see the [guide article on widgets](guide:structure-widgets). * - * @property string $id ID of the widget. + * @property string|null $id ID of the widget. Note that the type of this property differs in getter and + * setter. See [[getId()]] and [[setId()]] for details. * @property \yii\web\View $view The view object that can be used to render views or view files. Note that the - * type of this property differs in getter and setter. See [[getView()]] and [[setView()]] for details. - * @property string $viewPath The directory containing the view files for this widget. This property is + * type of this property differs in getter and setter. See [[getView()]] and [[setView()]] for details. + * @property-read string $viewPath The directory containing the view files for this widget. This property is * read-only. * * @author Qiang Xue diff --git a/framework/caching/MemCache.php b/framework/caching/MemCache.php index 0f2bcdcd04a..2a83e5d3fff 100644 --- a/framework/caching/MemCache.php +++ b/framework/caching/MemCache.php @@ -55,10 +55,10 @@ * * For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview). * - * @property \Memcache|\Memcached $memcache The memcache (or memcached) object used by this cache component. - * This property is read-only. + * @property-read \Memcache|\Memcached $memcache The memcache (or memcached) object used by this cache + * component. 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. + * property differs in getter and setter. See [[getServers()]] and [[setServers()]] for details. * * @author Qiang Xue * @since 2.0 diff --git a/framework/captcha/CaptchaAction.php b/framework/captcha/CaptchaAction.php index 3ded638459e..40e1aa03a0a 100644 --- a/framework/captcha/CaptchaAction.php +++ b/framework/captcha/CaptchaAction.php @@ -31,7 +31,7 @@ * to be validated by the 'captcha' validator. * 3. In the controller view, insert a [[Captcha]] widget in the form. * - * @property string $verifyCode The verification code. This property is read-only. + * @property-read string $verifyCode The verification code. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/console/Application.php b/framework/console/Application.php index 431198a3614..51d81e43b5c 100644 --- a/framework/console/Application.php +++ b/framework/console/Application.php @@ -50,9 +50,10 @@ * yii help * ``` * - * @property ErrorHandler $errorHandler The error handler application component. This property is read-only. - * @property Request $request The request component. This property is read-only. - * @property Response $response The response component. This property is read-only. + * @property-read ErrorHandler $errorHandler The error handler application component. This property is + * read-only. + * @property-read Request $request The request component. This property is read-only. + * @property-read Response $response The response component. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/console/Controller.php b/framework/console/Controller.php index b50ddf20607..4288f93c822 100644 --- a/framework/console/Controller.php +++ b/framework/console/Controller.php @@ -28,11 +28,11 @@ * where `` is a route to a controller action and the params will be populated as properties of a command. * See [[options()]] for details. * - * @property string $help This property is read-only. - * @property string $helpSummary This property is read-only. - * @property array $passedOptionValues The properties corresponding to the passed options. This property is - * read-only. - * @property array $passedOptions The names of the options passed during execution. This property is + * @property-read string $help This property is read-only. + * @property-read string $helpSummary This property is read-only. + * @property-read array $passedOptionValues The properties corresponding to the passed options. This property + * is read-only. + * @property-read array $passedOptions The names of the options passed during execution. This property is * read-only. * @property Request $request * @property Response $response diff --git a/framework/console/controllers/AssetController.php b/framework/console/controllers/AssetController.php index 4f2e492dcea..fe106f79bfd 100644 --- a/framework/console/controllers/AssetController.php +++ b/framework/console/controllers/AssetController.php @@ -39,7 +39,7 @@ * check [[jsCompressor]] and [[cssCompressor]] for more details. * * @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. + * differs in getter and setter. See [[getAssetManager()]] and [[setAssetManager()]] for details. * * @author Qiang Xue * @author Paul Klimov diff --git a/framework/console/controllers/HelpController.php b/framework/console/controllers/HelpController.php index b4db783c159..5185f4e011b 100644 --- a/framework/console/controllers/HelpController.php +++ b/framework/console/controllers/HelpController.php @@ -30,7 +30,7 @@ * In the above, if the command name is not provided, all * available commands will be displayed. * - * @property array $commands All available command names. This property is read-only. + * @property-read array $commands All available command names. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/console/widgets/Table.php b/framework/console/widgets/Table.php index 552680e721e..99fd5d23234 100644 --- a/framework/console/widgets/Table.php +++ b/framework/console/widgets/Table.php @@ -40,8 +40,8 @@ * ], * ]); * - * @property string $listPrefix List prefix. This property is write-only. - * @property int $screenWidth Screen width. This property is write-only. + * @property-write string $listPrefix List prefix. This property is write-only. + * @property-write int $screenWidth Screen width. This property is write-only. * * @author Daniel Gomez Pan * @since 2.0.13 diff --git a/framework/data/BaseDataProvider.php b/framework/data/BaseDataProvider.php index 82ac0d7fb92..97214cf602c 100644 --- a/framework/data/BaseDataProvider.php +++ b/framework/data/BaseDataProvider.php @@ -16,15 +16,15 @@ * * For more details and usage information on BaseDataProvider, see the [guide article on data providers](guide:output-data-providers). * - * @property int $count The number of data models in the current page. This property is read-only. + * @property-read int $count The number of data models in the current page. This property is read-only. * @property array $keys The list of key values corresponding to [[models]]. Each data model in [[models]] is * uniquely identified by the corresponding key value in this array. * @property array $models The list of data models in the current page. * @property Pagination|false $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 + * disabled. Note that the type of this property differs in getter and setter. See [[getPagination()]] and * [[setPagination()]] for details. * @property Sort|bool $sort The sorting object. If this is false, it means the sorting is disabled. Note that - * the type of this property differs in getter and setter. See [[getSort()]] and [[setSort()]] for details. + * the type of this property differs in getter and setter. See [[getSort()]] and [[setSort()]] for details. * @property int $totalCount Total number of possible data models. * * @author Qiang Xue diff --git a/framework/data/DataFilter.php b/framework/data/DataFilter.php index a10177fbf3a..2cf1838dc88 100644 --- a/framework/data/DataFilter.php +++ b/framework/data/DataFilter.php @@ -113,12 +113,13 @@ * @see ActiveDataFilter * * @property array $errorMessages Error messages in format `[errorKey => message]`. Note that the type of this - * property differs in getter and setter. See [[getErrorMessages()]] and [[setErrorMessages()]] for details. + * property differs in getter and setter. See [[getErrorMessages()]] and [[setErrorMessages()]] for details. * @property mixed $filter Raw filter value. * @property array $searchAttributeTypes Search attribute type map. Note that the type of this property - * differs in getter and setter. See [[getSearchAttributeTypes()]] and [[setSearchAttributeTypes()]] for details. + * differs in getter and setter. See [[getSearchAttributeTypes()]] and [[setSearchAttributeTypes()]] for + * details. * @property Model $searchModel Model instance. Note that the type of this property differs in getter and - * setter. See [[getSearchModel()]] and [[setSearchModel()]] for details. + * setter. See [[getSearchModel()]] and [[setSearchModel()]] for details. * * @author Paul Klimov * @since 2.0.13 diff --git a/framework/data/Pagination.php b/framework/data/Pagination.php index 32078b1c7e7..f593d9a9481 100644 --- a/framework/data/Pagination.php +++ b/framework/data/Pagination.php @@ -58,15 +58,15 @@ * * For more details and usage information on Pagination, see the [guide article on pagination](guide:output-pagination). * - * @property int $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 int $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-read int $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-read 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-read int $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 int $page The zero-based current page number. - * @property int $pageCount Number of pages. This property is read-only. + * @property-read int $pageCount Number of pages. This property is read-only. * @property int $pageSize The number of items per page. If it is less than 1, it means the page size is * infinite, and thus a single page contains all items. * diff --git a/framework/data/Sort.php b/framework/data/Sort.php index 78cc868a82e..d96178e1321 100644 --- a/framework/data/Sort.php +++ b/framework/data/Sort.php @@ -70,9 +70,9 @@ * * @property array $attributeOrders Sort directions indexed by attribute names. Sort direction can be either * `SORT_ASC` for ascending order or `SORT_DESC` for descending order. Note that the type of this property - * differs in getter and setter. See [[getAttributeOrders()]] and [[setAttributeOrders()]] for details. - * @property array $orders The columns (keys) and their corresponding sort directions (values). This can be - * passed to [[\yii\db\Query::orderBy()]] to construct a DB query. This property is read-only. + * differs in getter and setter. See [[getAttributeOrders()]] and [[setAttributeOrders()]] for details. + * @property-read array $orders The columns (keys) and their corresponding sort directions (values). This can + * be passed to [[\yii\db\Query::orderBy()]] to construct a DB query. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index c50ce07d742..ead5f5c7d6e 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -23,19 +23,19 @@ * * See [[\yii\db\ActiveRecord]] for a concrete implementation. * - * @property array $dirtyAttributes The changed attribute values (name-value pairs). This property is + * @property-read array $dirtyAttributes The changed attribute values (name-value pairs). This property is * read-only. * @property bool $isNewRecord Whether the record is new and should be inserted when calling [[save()]]. * @property array $oldAttributes The old attribute values (name-value pairs). Note that the type of this - * property differs in getter and setter. See [[getOldAttributes()]] and [[setOldAttributes()]] for details. - * @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is + * property differs in getter and setter. See [[getOldAttributes()]] and [[setOldAttributes()]] for details. + * @property-read mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is * returned if the primary key is composite. A string is returned otherwise (null will be returned if the key * value is null). This property is read-only. - * @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if - * the primary key is composite. A string is returned otherwise (null will be returned if the key value is null). - * This property is read-only. - * @property array $relatedRecords An array of related records indexed by relation names. This property is - * read-only. + * @property-read mixed $primaryKey The primary key value. An array (column name => column value) is returned + * if the primary key is composite. A string is returned otherwise (null will be returned if the key value is + * null). This property is read-only. + * @property-read array $relatedRecords An array of related records indexed by relation names. This property + * is read-only. * * @author Qiang Xue * @author Carsten Brandt diff --git a/framework/db/Connection.php b/framework/db/Connection.php index d69cb58edf5..5e2bd45a79c 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -111,24 +111,24 @@ * ``` * * @property string $driverName Name of the DB driver. - * @property bool $isActive Whether the DB connection is established. This property is read-only. - * @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the - * sequence object. This property is read-only. - * @property Connection $master The currently active master connection. `null` is returned if there is no + * @property-read bool $isActive Whether the DB connection is established. This property is read-only. + * @property-read string $lastInsertID The row ID of the last row inserted, or the last value retrieved from + * the sequence object. This property is read-only. + * @property-read Connection $master The currently active master connection. `null` is returned if there is no * master available. This property is read-only. - * @property PDO $masterPdo The PDO instance for the currently active master connection. This property is + * @property-read PDO $masterPdo The PDO instance for the currently active master connection. This property is * read-only. * @property QueryBuilder $queryBuilder The query builder for the current DB connection. Note that the type of - * this property differs in getter and setter. See [[getQueryBuilder()]] and [[setQueryBuilder()]] for details. - * @property Schema $schema The schema information for the database opened by this connection. This property - * is read-only. - * @property string $serverVersion Server version as a string. This property is read-only. - * @property Connection $slave The currently active slave connection. `null` is returned if there is no slave - * available and `$fallbackToMaster` is false. This property is read-only. - * @property PDO $slavePdo The PDO instance for the currently active slave connection. `null` is returned if - * no slave connection is available and `$fallbackToMaster` is false. This property is read-only. - * @property Transaction|null $transaction The currently active transaction. Null if no active transaction. - * This property is read-only. + * this property differs in getter and setter. See [[getQueryBuilder()]] and [[setQueryBuilder()]] for details. + * @property-read Schema $schema The schema information for the database opened by this connection. This + * property is read-only. + * @property-read string $serverVersion Server version as a string. This property is read-only. + * @property-read Connection $slave The currently active slave connection. `null` is returned if there is no + * slave available and `$fallbackToMaster` is false. This property is read-only. + * @property-read PDO $slavePdo The PDO instance for the currently active slave connection. `null` is returned + * if no slave connection is available and `$fallbackToMaster` is false. This property is read-only. + * @property-read Transaction|null $transaction The currently active transaction. Null if no active + * transaction. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/DataReader.php b/framework/db/DataReader.php index f2ef1eb312f..50a2d7dadc3 100644 --- a/framework/db/DataReader.php +++ b/framework/db/DataReader.php @@ -40,10 +40,10 @@ * [[fetchMode]]. See the [PHP manual](https://secure.php.net/manual/en/function.PDOStatement-setFetchMode.php) * for more details about possible fetch mode. * - * @property int $columnCount The number of columns in the result set. This property is read-only. - * @property int $fetchMode Fetch mode. This property is write-only. - * @property bool $isClosed Whether the reader is closed or not. This property is read-only. - * @property int $rowCount Number of rows contained in the result. This property is read-only. + * @property-read int $columnCount The number of columns in the result set. This property is read-only. + * @property-write int $fetchMode Fetch mode. This property is write-only. + * @property-read bool $isClosed Whether the reader is closed or not. This property is read-only. + * @property-read int $rowCount Number of rows contained in the result. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/Query.php b/framework/db/Query.php index 471f22f9f37..59dcb8382aa 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -42,7 +42,7 @@ * * A more detailed usage guide on how to work with Query can be found in the [guide article on Query Builder](guide:db-query-builder). * - * @property string[] $tablesUsedInFrom Table names indexed by aliases. This property is read-only. + * @property-read string[] $tablesUsedInFrom Table names indexed by aliases. This property is read-only. * * @author Qiang Xue * @author Carsten Brandt diff --git a/framework/db/QueryBuilder.php b/framework/db/QueryBuilder.php index 5015d3ba3fc..c6f74872313 100644 --- a/framework/db/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -22,10 +22,10 @@ * * For more details and usage information on QueryBuilder, see the [guide article on query builders](guide:db-query-builder). * - * @property string[] $conditionClasses Map of condition aliases to condition classes. For example: ```php - * ['LIKE' => yii\db\condition\LikeCondition::class] ``` . This property is write-only. - * @property string[] $expressionBuilders Array of builders that should be merged with the pre-defined ones in - * [[expressionBuilders]] property. This property is write-only. + * @property-write string[] $conditionClasses Map of condition aliases to condition classes. For example: + * ```php ['LIKE' => yii\db\condition\LikeCondition::class] ``` . This property is write-only. + * @property-write string[] $expressionBuilders Array of builders that should be merged with the pre-defined + * ones in [[expressionBuilders]] property. This property is write-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/Schema.php b/framework/db/Schema.php index c0ed7227c20..c11a22be210 100644 --- a/framework/db/Schema.php +++ b/framework/db/Schema.php @@ -21,17 +21,18 @@ * * Schema represents the database schema information that is DBMS specific. * - * @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the - * sequence object. This property is read-only. - * @property QueryBuilder $queryBuilder The query builder for this connection. This property is read-only. - * @property string[] $schemaNames All schema names in the database, except system schemas. This property is + * @property-read string $lastInsertID The row ID of the last row inserted, or the last value retrieved from + * the sequence object. This property is read-only. + * @property-read QueryBuilder $queryBuilder The query builder for this connection. This property is * read-only. - * @property string $serverVersion Server version as a string. This property is read-only. - * @property string[] $tableNames All table names in the database. This property is read-only. - * @property TableSchema[] $tableSchemas The metadata for all tables in the database. Each array element is an - * instance of [[TableSchema]] or its child class. This property is read-only. - * @property string $transactionIsolationLevel The transaction isolation level to use for this transaction. - * This can be one of [[Transaction::READ_UNCOMMITTED]], [[Transaction::READ_COMMITTED]], + * @property-read string[] $schemaNames All schema names in the database, except system schemas. This property + * is read-only. + * @property-read string $serverVersion Server version as a string. This property is read-only. + * @property-read string[] $tableNames All table names in the database. This property is read-only. + * @property-read TableSchema[] $tableSchemas The metadata for all tables in the database. Each array element + * is an instance of [[TableSchema]] or its child class. This property is read-only. + * @property-write string $transactionIsolationLevel The transaction isolation level to use for this + * transaction. This can be one of [[Transaction::READ_UNCOMMITTED]], [[Transaction::READ_COMMITTED]], * [[Transaction::REPEATABLE_READ]] and [[Transaction::SERIALIZABLE]] but also a string containing DBMS specific * syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. This property is write-only. * diff --git a/framework/db/SqlToken.php b/framework/db/SqlToken.php index 77497ee22f6..0e947c17458 100644 --- a/framework/db/SqlToken.php +++ b/framework/db/SqlToken.php @@ -13,10 +13,10 @@ * SqlToken represents SQL tokens produced by [[SqlTokenizer]] or its child classes. * * @property SqlToken[] $children Child tokens. - * @property bool $hasChildren Whether the token has children. This property is read-only. - * @property bool $isCollection Whether the token represents a collection of tokens. This property is + * @property-read bool $hasChildren Whether the token has children. This property is read-only. + * @property-read bool $isCollection Whether the token represents a collection of tokens. This property is * read-only. - * @property string $sql SQL code. This property is read-only. + * @property-read string $sql SQL code. This property is read-only. * * @author Sergey Makinen * @since 2.0.13 diff --git a/framework/db/TableSchema.php b/framework/db/TableSchema.php index 33e2c128864..899ddb8abb9 100644 --- a/framework/db/TableSchema.php +++ b/framework/db/TableSchema.php @@ -13,7 +13,7 @@ /** * TableSchema represents the metadata of a database table. * - * @property array $columnNames List of column names. This property is read-only. + * @property-read array $columnNames List of column names. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/Transaction.php b/framework/db/Transaction.php index 3935a2380ec..e6c1cbe93a2 100644 --- a/framework/db/Transaction.php +++ b/framework/db/Transaction.php @@ -39,13 +39,13 @@ * > with PHP 5.x and PHP 7.x. `\Exception` implements the [`\Throwable` interface](https://secure.php.net/manual/en/class.throwable.php) * > since PHP 7.0, so you can skip the part with `\Exception` if your app uses only PHP 7.0 and higher. * - * @property bool $isActive Whether this transaction is active. Only an active transaction can [[commit()]] or - * [[rollBack()]]. This property is read-only. - * @property string $isolationLevel The transaction isolation level to use for this transaction. This can be - * one of [[READ_UNCOMMITTED]], [[READ_COMMITTED]], [[REPEATABLE_READ]] and [[SERIALIZABLE]] but also a string - * containing DBMS specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. This property is + * @property-read bool $isActive Whether this transaction is active. Only an active transaction can + * [[commit()]] or [[rollBack()]]. This property is read-only. + * @property-write string $isolationLevel The transaction isolation level to use for this transaction. This + * can be one of [[READ_UNCOMMITTED]], [[READ_COMMITTED]], [[REPEATABLE_READ]] and [[SERIALIZABLE]] but also a + * string containing DBMS specific syntax to be used after `SET TRANSACTION ISOLATION LEVEL`. This property is * write-only. - * @property int $level The current nesting level of the transaction. This property is read-only. + * @property-read int $level The current nesting level of the transaction. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/mssql/ColumnSchema.php b/framework/db/mssql/ColumnSchema.php index b8b72d308d6..78895d6031f 100644 --- a/framework/db/mssql/ColumnSchema.php +++ b/framework/db/mssql/ColumnSchema.php @@ -20,6 +20,7 @@ class ColumnSchema extends \yii\db\ColumnSchema */ public $isComputed; + /** * Prepares default value and converts it according to [[phpType]] * @param mixed $value default value diff --git a/framework/db/oci/Schema.php b/framework/db/oci/Schema.php index 23ad65b394c..2e55c09db77 100644 --- a/framework/db/oci/Schema.php +++ b/framework/db/oci/Schema.php @@ -24,8 +24,8 @@ /** * Schema is the class for retrieving metadata from an Oracle database. * - * @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the - * sequence object. This property is read-only. + * @property-read string $lastInsertID The row ID of the last row inserted, or the last value retrieved from + * the sequence object. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/db/sqlite/Schema.php b/framework/db/sqlite/Schema.php index ccd6e2bf6ae..0b5a0cc8ec9 100644 --- a/framework/db/sqlite/Schema.php +++ b/framework/db/sqlite/Schema.php @@ -24,9 +24,9 @@ /** * Schema is the class for retrieving metadata from a SQLite (2/3) database. * - * @property string $transactionIsolationLevel The transaction isolation level to use for this transaction. - * This can be either [[Transaction::READ_UNCOMMITTED]] or [[Transaction::SERIALIZABLE]]. This property is - * write-only. + * @property-write string $transactionIsolationLevel The transaction isolation level to use for this + * transaction. This can be either [[Transaction::READ_UNCOMMITTED]] or [[Transaction::SERIALIZABLE]]. This + * property is write-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/di/Container.php b/framework/di/Container.php index b29ab80cacd..db21ed7fd48 100644 --- a/framework/di/Container.php +++ b/framework/di/Container.php @@ -91,10 +91,10 @@ * * For more details and usage information on Container, see the [guide article on di-containers](guide:concept-di-container). * - * @property array $definitions The list of the object definitions or the loaded shared objects (type or ID => - * definition or instance). This property is read-only. - * @property bool $resolveArrays Whether to attempt to resolve elements in array dependencies. This property - * is write-only. + * @property-read array $definitions The list of the object definitions or the loaded shared objects (type or + * ID => definition or instance). This property is read-only. + * @property-write bool $resolveArrays Whether to attempt to resolve elements in array dependencies. This + * property is write-only. * * @author Qiang Xue * @since 2.0 @@ -150,7 +150,7 @@ class Container extends Component * - Parameters in the order they appear in the constructor declaration. If you want to skip some parameters, * you should index the remaining ones with the integers that represent their positions in the constructor * parameter list. - * Dependencies indexed by name and by position in the same array are not allowed. + * Dependencies indexed by name and by position in the same array are not allowed. * @param array $config a list of name-value pairs that will be used to initialize the object properties. * @return object an instance of the requested class. * @throws InvalidConfigException if the class cannot be recognized or correspond to an invalid definition diff --git a/framework/i18n/I18N.php b/framework/i18n/I18N.php index 49cf93bd459..3e5bd425d19 100644 --- a/framework/i18n/I18N.php +++ b/framework/i18n/I18N.php @@ -19,7 +19,7 @@ * * @property MessageFormatter $messageFormatter The message formatter to be used to format message via ICU * message format. Note that the type of this property differs in getter and setter. See - * [[getMessageFormatter()]] and [[setMessageFormatter()]] for details. + * [[getMessageFormatter()]] and [[setMessageFormatter()]] for details. * * @author Qiang Xue * @since 2.0 diff --git a/framework/i18n/Locale.php b/framework/i18n/Locale.php index 6567c083f59..86b78de6a88 100644 --- a/framework/i18n/Locale.php +++ b/framework/i18n/Locale.php @@ -16,7 +16,7 @@ * * The class requires [PHP intl extension](https://secure.php.net/manual/en/book.intl.php) to be installed. * - * @property string $currencySymbol This property is read-only. + * @property-read string $currencySymbol This property is read-only. * * @since 2.0.14 */ diff --git a/framework/i18n/MessageFormatter.php b/framework/i18n/MessageFormatter.php index 2b11c034b5d..2fdba093213 100644 --- a/framework/i18n/MessageFormatter.php +++ b/framework/i18n/MessageFormatter.php @@ -36,8 +36,8 @@ * Also messages that are working with the fallback implementation are not necessarily compatible with the * PHP intl MessageFormatter so do not rely on the fallback if you are able to install intl extension somehow. * - * @property string $errorCode Code of the last error. This property is read-only. - * @property string $errorMessage Description of the last error. This property is read-only. + * @property-read string $errorCode Code of the last error. This property is read-only. + * @property-read string $errorMessage Description of the last error. This property is read-only. * * @author Alexander Makarov * @author Carsten Brandt diff --git a/framework/log/Dispatcher.php b/framework/log/Dispatcher.php index 8109e0b8978..d888d89a8d1 100644 --- a/framework/log/Dispatcher.php +++ b/framework/log/Dispatcher.php @@ -53,7 +53,7 @@ * @property int $flushInterval How many messages should be logged before they are sent to targets. This * method returns the value of [[Logger::flushInterval]]. * @property Logger $logger The logger. If not set, [[\Yii::getLogger()]] will be used. Note that the type of - * this property differs in getter and setter. See [[getLogger()]] and [[setLogger()]] for details. + * this property differs in getter and setter. See [[getLogger()]] and [[setLogger()]] for details. * @property int $traceLevel How many application call stacks should be logged together with each message. * This method returns the value of [[Logger::traceLevel]]. Defaults to 0. * diff --git a/framework/log/Logger.php b/framework/log/Logger.php index 9bbfa4e89a5..6a6f3b9a85e 100644 --- a/framework/log/Logger.php +++ b/framework/log/Logger.php @@ -30,13 +30,13 @@ * to send logged messages to different log targets, such as [[FileTarget|file]], [[EmailTarget|email]], * or [[DbTarget|database]], with the help of the [[dispatcher]]. * - * @property array $dbProfiling The first element indicates the number of SQL statements executed, and the - * second element the total time spent in SQL execution. This property is read-only. - * @property float $elapsedTime The total elapsed time in seconds for current request. This property is + * @property-read array $dbProfiling The first element indicates the number of SQL statements executed, and + * the second element the total time spent in SQL execution. This property is read-only. + * @property-read float $elapsedTime The total elapsed time in seconds for current request. This property is * read-only. - * @property array $profiling The profiling results. Each element is an array consisting of these elements: - * `info`, `category`, `timestamp`, `trace`, `level`, `duration`, `memory`, `memoryDiff`. The `memory` and - * `memoryDiff` values are available since version 2.0.11. This property is read-only. + * @property-read array $profiling The profiling results. Each element is an array consisting of these + * elements: `info`, `category`, `timestamp`, `trace`, `level`, `duration`, `memory`, `memoryDiff`. The `memory` + * and `memoryDiff` values are available since version 2.0.11. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/log/Target.php b/framework/log/Target.php index 2a192e80d55..846bc919a9f 100644 --- a/framework/log/Target.php +++ b/framework/log/Target.php @@ -27,10 +27,10 @@ * may specify [[except]] to exclude messages of certain categories. * * @property bool $enabled Indicates whether this log target is enabled. Defaults to true. Note that the type - * of this property differs in getter and setter. See [[getEnabled()]] and [[setEnabled()]] for details. + * of this property differs in getter and setter. See [[getEnabled()]] and [[setEnabled()]] for details. * @property int $levels The message levels that this target is interested in. This is a bitmap of level * 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. + * setter. See [[getLevels()]] and [[setLevels()]] for details. * * For more details and usage information on Target, see the [guide article on logging & targets](guide:runtime-logging). * diff --git a/framework/mail/BaseMailer.php b/framework/mail/BaseMailer.php index c4546fbd1f4..633974daa2f 100644 --- a/framework/mail/BaseMailer.php +++ b/framework/mail/BaseMailer.php @@ -23,7 +23,7 @@ * For more details and usage information on BaseMailer, see the [guide article on mailing](guide:tutorial-mailing). * * @property View $view View instance. Note that the type of this property differs in getter and setter. See - * [[getView()]] and [[setView()]] for details. + * [[getView()]] and [[setView()]] for details. * @property string $viewPath The directory that contains the view files for composing mail messages Defaults * to '@app/mail'. * diff --git a/framework/rbac/BaseManager.php b/framework/rbac/BaseManager.php index 4f832e014d6..c8dda76f930 100644 --- a/framework/rbac/BaseManager.php +++ b/framework/rbac/BaseManager.php @@ -17,10 +17,10 @@ * * For more details and usage information on DbManager, see the [guide article on security authorization](guide:security-authorization). * - * @property Role[] $defaultRoleInstances Default roles. The array is indexed by the role names. This property - * is read-only. + * @property-read Role[] $defaultRoleInstances Default roles. The array is indexed by the role names. This + * property is read-only. * @property string[] $defaultRoles Default roles. Note that the type of this property differs in getter and - * setter. See [[getDefaultRoles()]] and [[setDefaultRoles()]] for details. + * setter. See [[getDefaultRoles()]] and [[setDefaultRoles()]] for details. * * @author Qiang Xue * @since 2.0 diff --git a/framework/test/ActiveFixture.php b/framework/test/ActiveFixture.php index 6d93b79c010..ff626a43b5f 100644 --- a/framework/test/ActiveFixture.php +++ b/framework/test/ActiveFixture.php @@ -24,7 +24,7 @@ * * For more details and usage information on ActiveFixture, see the [guide article on fixtures](guide:test-fixtures). * - * @property TableSchema $tableSchema The schema information of the database table associated with this + * @property-read TableSchema $tableSchema The schema information of the database table associated with this * fixture. This property is read-only. * * @author Qiang Xue diff --git a/framework/validators/FileValidator.php b/framework/validators/FileValidator.php index c941ff6f48e..d67934ffd74 100644 --- a/framework/validators/FileValidator.php +++ b/framework/validators/FileValidator.php @@ -20,7 +20,7 @@ * * Note that you should enable `fileinfo` PHP extension. * - * @property int $sizeLimit The size limit for uploaded files. This property is read-only. + * @property-read int $sizeLimit The size limit for uploaded files. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/validators/Validator.php b/framework/validators/Validator.php index 19800a1cd56..5b808acd271 100644 --- a/framework/validators/Validator.php +++ b/framework/validators/Validator.php @@ -48,8 +48,8 @@ * * For more details and usage information on Validator, see the [guide article on validators](guide:input-validation). * - * @property array $attributeNames Attribute names. This property is read-only. - * @property array $validationAttributes List of attribute names. This property is read-only. + * @property-read array $attributeNames Attribute names. This property is read-only. + * @property-read array $validationAttributes List of attribute names. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/Application.php b/framework/web/Application.php index f20c2f85213..6a052f19d3d 100644 --- a/framework/web/Application.php +++ b/framework/web/Application.php @@ -16,12 +16,13 @@ * * For more details and usage information on Application, see the [guide article on applications](guide:structure-applications). * - * @property ErrorHandler $errorHandler The error handler application component. This property is read-only. + * @property-read ErrorHandler $errorHandler The error handler application component. This property is + * read-only. * @property string $homeUrl The homepage URL. - * @property Request $request The request component. This property is read-only. - * @property Response $response The response component. This property is read-only. - * @property Session $session The session component. This property is read-only. - * @property User $user The user component. This property is read-only. + * @property-read Request $request The request component. This property is read-only. + * @property-read Response $response The response component. This property is read-only. + * @property-read Session $session The session component. This property is read-only. + * @property-read User $user The user component. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/AssetManager.php b/framework/web/AssetManager.php index 70346871cf7..215f5b1ac8d 100644 --- a/framework/web/AssetManager.php +++ b/framework/web/AssetManager.php @@ -34,7 +34,7 @@ * For more details and usage information on AssetManager, see the [guide article on assets](guide:structure-assets). * * @property AssetConverterInterface $converter The asset converter. Note that the type of this property - * differs in getter and setter. See [[getConverter()]] and [[setConverter()]] for details. + * differs in getter and setter. See [[getConverter()]] and [[setConverter()]] for details. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/CacheSession.php b/framework/web/CacheSession.php index 7cbc580547c..ecb14b782a1 100644 --- a/framework/web/CacheSession.php +++ b/framework/web/CacheSession.php @@ -31,7 +31,7 @@ * ] * ``` * - * @property bool $useCustomStorage Whether to use custom storage. This property is read-only. + * @property-read bool $useCustomStorage Whether to use custom storage. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/CompositeUrlRule.php b/framework/web/CompositeUrlRule.php index d985f078010..d707c64ccc4 100644 --- a/framework/web/CompositeUrlRule.php +++ b/framework/web/CompositeUrlRule.php @@ -13,8 +13,8 @@ /** * CompositeUrlRule is the base class for URL rule classes that consist of multiple simpler rules. * - * @property null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call. `null` - * if rule does not provide info about create status. This property is read-only. + * @property-read null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call. + * `null` if rule does not provide info about create status. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/CookieCollection.php b/framework/web/CookieCollection.php index e5b2b688f16..c26cfd35445 100644 --- a/framework/web/CookieCollection.php +++ b/framework/web/CookieCollection.php @@ -17,9 +17,9 @@ * * For more details and usage information on CookieCollection, see the [guide article on handling cookies](guide:runtime-sessions-cookies). * - * @property int $count The number of cookies in the collection. This property is read-only. - * @property ArrayIterator $iterator An iterator for traversing the cookies in the collection. This property - * is read-only. + * @property-read int $count The number of cookies in the collection. This property is read-only. + * @property-read ArrayIterator $iterator An iterator for traversing the cookies in the collection. This + * property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/HeaderCollection.php b/framework/web/HeaderCollection.php index 7c135d26824..1fa6021f7b4 100644 --- a/framework/web/HeaderCollection.php +++ b/framework/web/HeaderCollection.php @@ -13,9 +13,9 @@ /** * HeaderCollection is used by [[Response]] to maintain the currently registered HTTP headers. * - * @property int $count The number of headers in the collection. This property is read-only. - * @property \ArrayIterator $iterator An iterator for traversing the headers in the collection. This property - * is read-only. + * @property-read int $count The number of headers in the collection. This property is read-only. + * @property-read \ArrayIterator $iterator An iterator for traversing the headers in the collection. This + * property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/MultiFieldSession.php b/framework/web/MultiFieldSession.php index cd26d120aca..1b73e6d583e 100644 --- a/framework/web/MultiFieldSession.php +++ b/framework/web/MultiFieldSession.php @@ -22,7 +22,7 @@ * While extending this class you should use [[composeFields()]] method - while writing the session data into the storage and * [[extractData()]] - while reading session data from the storage. * - * @property bool $useCustomStorage Whether to use custom storage. This property is read-only. + * @property-read bool $useCustomStorage Whether to use custom storage. This property is read-only. * * @author Paul Klimov * @since 2.0.6 diff --git a/framework/web/Request.php b/framework/web/Request.php index a99c2b3d379..6ebd807a8bd 100644 --- a/framework/web/Request.php +++ b/framework/web/Request.php @@ -23,70 +23,73 @@ * * For more details and usage information on Request, see the [guide article on requests](guide:runtime-requests). * - * @property string $absoluteUrl The currently requested absolute URL. This property is read-only. + * @property-read string $absoluteUrl The currently requested absolute URL. This property is read-only. * @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 array $authCredentials That contains exactly two elements: - 0: the username sent via HTTP + * @property-read array $authCredentials That contains exactly two elements: - 0: the username sent via HTTP * authentication, `null` if the username is not given - 1: the password sent via HTTP authentication, `null` if * the password is not given. This property is read-only. - * @property string|null $authPassword The password sent via HTTP authentication, `null` if the password is + * @property-read string|null $authPassword The password sent via HTTP authentication, `null` if the password + * is not given. This property is read-only. + * @property-read string|null $authUser The username sent via HTTP authentication, `null` if the username is * not given. This property is read-only. - * @property string|null $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. - * This property is read-only. - * @property CookieCollection $cookies The cookie collection. This property is read-only. - * @property string $csrfToken The token used to perform CSRF validation. This property is read-only. - * @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. - * @property array $eTags The entity tags. This property is read-only. - * @property HeaderCollection $headers The header collection. This property is read-only. + * @property-read string $contentType Request content-type. Null is returned if this information is not + * available. This property is read-only. + * @property-read CookieCollection $cookies The cookie collection. This property is read-only. + * @property-read string $csrfToken The token used to perform CSRF validation. This property is read-only. + * @property-read 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. + * @property-read array $eTags The entity tags. This property is read-only. + * @property-read HeaderCollection $headers The header collection. This property is read-only. * @property string|null $hostInfo Schema and hostname part (with port number if needed) of the request URL * (e.g. `http://www.yiiframework.com`), null if can't be obtained from `$_SERVER` and wasn't set. See * [[getHostInfo()]] for security related notes on this property. - * @property string|null $hostName Hostname part of the request URL (e.g. `www.yiiframework.com`). This + * @property-read string|null $hostName Hostname part of the request URL (e.g. `www.yiiframework.com`). This * property is read-only. - * @property bool $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only. - * @property bool $isDelete Whether this is a DELETE request. This property is read-only. - * @property bool $isFlash Whether this is an Adobe Flash or Adobe Flex request. This property is read-only. - * @property bool $isGet Whether this is a GET request. This property is read-only. - * @property bool $isHead Whether this is a HEAD request. This property is read-only. - * @property bool $isOptions Whether this is a OPTIONS request. This property is read-only. - * @property bool $isPatch Whether this is a PATCH request. This property is read-only. - * @property bool $isPjax Whether this is a PJAX request. This property is read-only. - * @property bool $isPost Whether this is a POST request. This property is read-only. - * @property bool $isPut Whether this is a PUT request. This property is read-only. - * @property bool $isSecureConnection If the request is sent via secure channel (https). This property is + * @property-read bool $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only. + * @property-read bool $isDelete Whether this is a DELETE request. This property is read-only. + * @property-read bool $isFlash Whether this is an Adobe Flash or Adobe Flex request. This property is * read-only. - * @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. - * @property string|null $origin URL origin of a CORS request, `null` if not available. This property is + * @property-read bool $isGet Whether this is a GET request. This property is read-only. + * @property-read bool $isHead Whether this is a HEAD request. This property is read-only. + * @property-read bool $isOptions Whether this is a OPTIONS request. This property is read-only. + * @property-read bool $isPatch Whether this is a PATCH request. This property is read-only. + * @property-read bool $isPjax Whether this is a PJAX request. This property is read-only. + * @property-read bool $isPost Whether this is a POST request. This property is read-only. + * @property-read bool $isPut Whether this is a PUT request. This property is read-only. + * @property-read bool $isSecureConnection If the request is sent via secure channel (https). This property is + * read-only. + * @property-read 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. + * @property-read string|null $origin URL origin of a CORS request, `null` if not available. This property is * read-only. * @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. * @property int $port Port number for insecure requests. * @property array $queryParams The request GET parameter values. - * @property string $queryString Part of the request URL that is after the question mark. This property is - * read-only. + * @property-read string $queryString Part of the request URL that is after the question mark. This property + * is read-only. * @property string $rawBody The request body. - * @property string|null $referrer URL referrer, null if not available. This property is read-only. - * @property string|null $remoteHost Remote host name, `null` if not available. This property is read-only. - * @property string|null $remoteIP Remote IP address, `null` if not available. This property is read-only. + * @property-read string|null $referrer URL referrer, null if not available. This property is read-only. + * @property-read string|null $remoteHost Remote host name, `null` if not available. This property is + * read-only. + * @property-read string|null $remoteIP Remote IP address, `null` if not available. This property is + * read-only. * @property string $scriptFile The entry script file path. * @property string $scriptUrl The relative URL of the entry script. * @property int $securePort Port number for secure requests. - * @property string $serverName Server name, null if not available. This property is read-only. - * @property int|null $serverPort Server port number, null if not available. This property is read-only. + * @property-read string $serverName Server name, null if not available. This property is read-only. + * @property-read int|null $serverPort Server port number, null if not available. This property is read-only. * @property string $url The currently requested relative URL. Note that the URI returned may be URL-encoded * depending on the client. - * @property string|null $userAgent User agent, null if not available. This property is read-only. - * @property string|null $userHost User host name, null if not available. This property is read-only. - * @property string|null $userIP User IP address, null if not available. This property is read-only. + * @property-read string|null $userAgent User agent, null if not available. This property is read-only. + * @property-read string|null $userHost User host name, null if not available. This property is read-only. + * @property-read string|null $userIP User IP address, null if not available. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/Response.php b/framework/web/Response.php index f5720bbb8dc..cbeac1ba37f 100644 --- a/framework/web/Response.php +++ b/framework/web/Response.php @@ -37,23 +37,27 @@ * * For more details and usage information on Response, see the [guide article on responses](guide:runtime-responses). * - * @property CookieCollection $cookies The cookie collection. This property is read-only. - * @property string $downloadHeaders The attachment file name. This property is write-only. - * @property HeaderCollection $headers The header collection. This property is read-only. - * @property bool $isClientError Whether this response indicates a client error. This property is read-only. - * @property bool $isEmpty Whether this response is empty. This property is read-only. - * @property bool $isForbidden Whether this response indicates the current request is forbidden. This property - * is read-only. - * @property bool $isInformational Whether this response is informational. This property is read-only. - * @property bool $isInvalid Whether this response has a valid [[statusCode]]. This property is read-only. - * @property bool $isNotFound Whether this response indicates the currently requested resource is not found. - * This property is read-only. - * @property bool $isOk Whether this response is OK. This property is read-only. - * @property bool $isRedirection Whether this response is a redirection. This property is read-only. - * @property bool $isServerError Whether this response indicates a server error. This property is read-only. - * @property bool $isSuccessful Whether this response is successful. This property is read-only. + * @property-read CookieCollection $cookies The cookie collection. This property is read-only. + * @property-write string $downloadHeaders The attachment file name. This property is write-only. + * @property-read HeaderCollection $headers The header collection. This property is read-only. + * @property-read bool $isClientError Whether this response indicates a client error. This property is + * read-only. + * @property-read bool $isEmpty Whether this response is empty. This property is read-only. + * @property-read bool $isForbidden Whether this response indicates the current request is forbidden. This + * property is read-only. + * @property-read bool $isInformational Whether this response is informational. This property is read-only. + * @property-read bool $isInvalid Whether this response has a valid [[statusCode]]. This property is + * read-only. + * @property-read bool $isNotFound Whether this response indicates the currently requested resource is not + * found. This property is read-only. + * @property-read bool $isOk Whether this response is OK. This property is read-only. + * @property-read bool $isRedirection Whether this response is a redirection. This property is read-only. + * @property-read bool $isServerError Whether this response indicates a server error. This property is + * read-only. + * @property-read bool $isSuccessful Whether this response is successful. This property is read-only. * @property int $statusCode The HTTP status code to send with the response. - * @property \Exception|\Error $statusCodeByException The exception object. This property is write-only. + * @property-write \Exception|\Error|\Throwable $statusCodeByException The exception object. This property is + * write-only. * * @author Qiang Xue * @author Carsten Brandt diff --git a/framework/web/Session.php b/framework/web/Session.php index 4d9311608ad..03d4ece7c63 100644 --- a/framework/web/Session.php +++ b/framework/web/Session.php @@ -45,31 +45,30 @@ * * For more details and usage information on Session, see the [guide article on sessions](guide:runtime-sessions-cookies). * - * @property array $allFlashes Flash messages (key => message or key => [message1, message2]). This property - * is read-only. - * @property string $cacheLimiter Current cache limiter. This property is read-only. - * @property array $cookieParams The session cookie parameters. This property is read-only. - * @property int $count The number of session variables. This property is read-only. - * @property string $flash The key identifying the flash message. Note that flash messages and normal session - * variables share the same name space. If you have a normal session variable using the same name, its value will - * be overwritten by this method. This property is write-only. + * @property-read array $allFlashes Flash messages (key => message or key => [message1, message2]). This + * property is read-only. + * @property-read string $cacheLimiter Current cache limiter. This property is read-only. + * @property-read array $cookieParams The session cookie parameters. This property is read-only. + * @property-read int $count The number of session variables. This property is read-only. + * @property-write string $flash The key identifying the flash message. Note that flash messages and normal + * session variables share the same name space. If you have a normal session variable using the same name, its + * value will 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. * @property bool $hasSessionId Whether the current request has sent the session ID. * @property string $id The current session ID. - * @property bool $isActive Whether the session has started. This property is read-only. - * @property SessionIterator $iterator An iterator for traversing the session variables. This property is + * @property-read bool $isActive Whether the session has started. This property is read-only. + * @property-read SessionIterator $iterator An iterator for traversing the session variables. This property is * read-only. * @property string $name The current session name. * @property string $savePath The current session save path, defaults to '/tmp'. * @property int $timeout The number of seconds after which data will be seen as 'garbage' and cleaned up. The * default value is 1440 seconds (or the value of "session.gc_maxlifetime" set in php.ini). * @property bool|null $useCookies The value indicating whether cookies should be used to store session IDs. - * @property bool $useCustomStorage Whether to use custom storage. This property is read-only. + * @property-read bool $useCustomStorage Whether to use custom storage. This property is read-only. + * @property-read bool $useStrictMode Whether strict mode is enabled or not. This property is read-only. * @property bool $useTransparentSessionID Whether transparent sid support is enabled or not, defaults to * false. - * @property bool $useStrictMode Whether strict mode is enabled or not. - * Note: Enabling `useStrictMode` on PHP < 5.5.2 is only supported with custom storage classes. * * @author Qiang Xue * @since 2.0 @@ -81,12 +80,10 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co * restored when a Session component without custom handler is used after one that has. */ static protected $_originalSessionModule = null; - /** * Polyfill for ini directive session.use-strict-mode for PHP < 5.5.2. */ static private $_useStrictModePolyfill = false; - /** * @var string the name of the session variable that stores the flash message data. */ @@ -95,6 +92,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co * @var \SessionHandlerInterface|array an object implementing the SessionHandlerInterface or a configuration array. If set, will be used to provide persistency instead of build-in methods. */ public $handler; + /** * @var string|null Holds the session id in case useStrictMode is enabled and the session id needs to be regenerated */ diff --git a/framework/web/UploadedFile.php b/framework/web/UploadedFile.php index 7a97b30c7b8..ed8fa111b89 100644 --- a/framework/web/UploadedFile.php +++ b/framework/web/UploadedFile.php @@ -22,10 +22,10 @@ * * For more details and usage information on UploadedFile, see the [guide article on handling uploads](guide:input-file-upload). * - * @property string $baseName Original file base name. This property is read-only. - * @property string $extension File extension. This property is read-only. - * @property bool $hasError Whether there is an error with the uploaded file. Check [[error]] for detailed - * error code information. This property is read-only. + * @property-read string $baseName Original file base name. This property is read-only. + * @property-read string $extension File extension. This property is read-only. + * @property-read bool $hasError Whether there is an error with the uploaded file. Check [[error]] for + * detailed error code information. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/UrlRule.php b/framework/web/UrlRule.php index 2f0582350fb..25d3cd81faf 100644 --- a/framework/web/UrlRule.php +++ b/framework/web/UrlRule.php @@ -24,8 +24,8 @@ * ] * ``` * - * @property null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call. `null` - * if rule does not provide info about create status. This property is read-only. + * @property-read null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call. + * `null` if rule does not provide info about create status. This property is read-only. * * @author Qiang Xue * @since 2.0 diff --git a/framework/web/User.php b/framework/web/User.php index 3e4db6a9ef1..db1935fe605 100644 --- a/framework/web/User.php +++ b/framework/web/User.php @@ -47,13 +47,13 @@ * ] * ``` * - * @property string|int $id The unique identifier for the user. If `null`, it means the user is a guest. This - * property is read-only. + * @property-read string|int $id The unique identifier for the user. If `null`, it means the user is a guest. + * This property is read-only. * @property IdentityInterface|null $identity The identity object associated with the currently logged-in * user. `null` is returned if the user is not logged in (not authenticated). - * @property bool $isGuest Whether the current user is a guest. This property is read-only. + * @property-read bool $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. + * of this property differs in getter and setter. See [[getReturnUrl()]] and [[setReturnUrl()]] for details. * * @author Qiang Xue * @since 2.0 diff --git a/framework/widgets/FragmentCache.php b/framework/widgets/FragmentCache.php index d9bed1f1b93..e30e997218c 100644 --- a/framework/widgets/FragmentCache.php +++ b/framework/widgets/FragmentCache.php @@ -18,8 +18,8 @@ /** * FragmentCache is used by [[\yii\base\View]] to provide caching of page fragments. * - * @property string|false $cachedContent The cached content. False is returned if valid content is not found - * in the cache. This property is read-only. + * @property-read string|false $cachedContent The cached content. False is returned if valid content is not + * found in the cache. This property is read-only. * * @author Qiang Xue * @since 2.0