Skip to content

Commit 22614a5

Browse files
committed
release version 2.0.46
1 parent e296f40 commit 22614a5

16 files changed

+56
-63
lines changed

Diff for: framework/BaseYii.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class BaseYii
9393
*/
9494
public static function getVersion()
9595
{
96-
return '2.0.46-dev';
96+
return '2.0.46';
9797
}
9898

9999
/**

Diff for: framework/CHANGELOG.md

+30-29
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,52 @@
11
Yii Framework 2 Change Log
22
==========================
33

4-
2.0.46 under development
5-
------------------------
4+
2.0.46 August 18, 2022
5+
----------------------
66

7-
- Bug #19467: Revert changes in `Inflector::camel2words()` introduced in #19204 (samdark)
8-
- Bug #19471: Enable console commands on hosting with disabled `exec()` function (WinterSilence, lubosdz)
9-
- Bug #19469: Fix a virtual relation not working because of new isset checks in `\yii\db\ActiveRelationTrait` (wvanheumen)
10-
- Bug #19380: Fix PHP 8.1 passing non string to trim() in `yii\db\Query` (wa1kb0y)
11-
- Bug #19272: Fix bug in dirty attributes check on multidimensional array (speedplli)
12-
- Bug #19349: Fix PHP 8.1 error when attribute and label of `yii\grid\DataColumn` are empty (githubjeka)
13-
- Bug #19243: Handle `finfo_open` for tar.xz as `application/octet-stream` on PHP 8.1 (longthanhtran)
147
- Bug #19235: Fix return type compatibility of `yii\web\SessionIterator` class methods for PHP 8.1 (virtual-designer)
8+
- Bug #19237: Fix OCI PHP 8.1 passing `null` to trim() (longthanhtran)
9+
- Bug #19243: Handle `finfo_open` for tar.xz as `application/octet-stream` on PHP 8.1 (longthanhtran)
1510
- Bug #19256: Pass missed `$view` to user's callback in `yii\validators\InlineValidator::clientValidateAttribute()` (WinterSilence)
16-
- Enh #19270: Replace deprecated `scss` converter in `yii\web\AssetConverter::$commands` (WinterSilence)
17-
- Enh #19254: Support specifying custom characters for `yii.validation.trim()` and replace deprecated `jQuery.trim()` (WinterSilence)
11+
- Bug #19259: Fix `yii\log\FileTarget` locking and always rotate files only by copy (bizley, mikehaertl)
12+
- Bug #19272: Fix bug in dirty attributes check on multidimensional array (speedplli)
1813
- Bug #19291: Reset errors and validators in `yii\base\Model::__clone()` (WinterSilence)
19-
- Enh #19295: Add alias `text/rtf` for mime-type `application/rtf` (lesha724)
20-
- Enh #19308: Add `yii\web\UploadedFile::$fullPath` represents 'full_path' key added in PHP 8.1 (WinterSilence)
2114
- Bug #19303: Fix serialization in `yii\caching\Dependency::generateReusableHash()` (WinterSilence)
22-
- Enh #19304: Add filtering validator `yii\validators\TrimValidator` (WinterSilence)
23-
- Enh #19309: Optimize `yii\base\Model::attributes()` (WinterSilence)
15+
- Bug #19312: Fix PHP 8.1 error when passing null to `yii\helpers\BaseInflector` (WinterSilence)
2416
- Bug #19322: Revert force setting value to empty string in case it's `null` in `yii\validators\FilterValidator::validateAttribute()` (bizley)
2517
- Bug #19324: Fix `yii\helpers\BaseHtml::renderSelectOptions()` giving wrong selection for boolean attributes (adnandautovic)
26-
- Bug #19329: Fix `yii\web\GroupUrlRule` to properly normalize prefix (bizley)
2718
- Bug #19328: Passing null to parameter #1 ($string) of type string is deprecated in `yii\db\oci\Schema` (Arkeins)
28-
- Enh #19318: Add support for typecasting PHP 8.1 enums (EtienneBruines)
29-
- Bug #19237: Fix OCI PHP 8.1 passing `null` to trim() (longthanhtran)
30-
- Bug #19312: Fix PHP 8.1 error when passing null to `yii\helpers\BaseInflector` (WinterSilence)
19+
- Bug #19329: Fix `yii\web\GroupUrlRule` to properly normalize prefix (bizley)
20+
- Bug #19349: Fix PHP 8.1 error when attribute and label of `yii\grid\DataColumn` are empty (githubjeka)
3121
- Bug #19368: Fix PHP 8.1 error when `$fileMimeType` is `null` in `yii\validators\FileValidator::validateMimeType()` (bizley)
32-
- Enh #19384: Normalize `setBodyParams()` and `getBodyParam()` in `yii\web\Request` (WinterSilence, albertborsos)
22+
- Bug #19380: Fix PHP 8.1 passing non string to trim() in `yii\db\Query` (wa1kb0y)
3323
- Bug #19386: Fix recursive calling `yii\helpers\BaseArrayHelper::htmlDecode()` (WinterSilence)
34-
- Bug #19407: Fix `yii\validators\UniqueValidator` and `yii\validators\ExistValidator` to respect `skipOnError` option for target attributes (bizley)
35-
- Bug #19418: Fix `yii\filters\auth\CompositeAuth` ignoring `only` and `except` options (lesha724)
36-
- Enh #19401: Delay `exit(1)` in `yii\base\ErrorHandler::handleFatalError` (arrilot)
24+
- Bug #19400: Fix passing null in `yii\web\Response::redirect()` (bizley)
3725
- Bug #19402: Add shutdown event and fix working directory in `yii\base\ErrorHandler` (WinterSilence)
38-
- Enh #19416: Update and improve configurations for `yii\console\controllers\MessageController` (WinterSilence)
3926
- Bug #19403: Fix types in `yii\web\SessionIterator` (WinterSilence)
40-
- Enh #19420: Update list of JS callbacks in `yii\widgets\MaskedInput` (WinterSilence)
41-
- Bug #19400: Fix passing null in `yii\web\Response::redirect()` (bizley)
42-
- Enh #19437: Add support to specify request port by trusted proxies in `\yii\web\Request::getServerPort()` (rhertogh)
27+
- Bug #19407: Fix `yii\validators\UniqueValidator` and `yii\validators\ExistValidator` to respect `skipOnError` option for target attributes (bizley)
28+
- Bug #19418: Fix `yii\filters\auth\CompositeAuth` ignoring `only` and `except` options (lesha724)
4329
- Bug #19445: Fix caching in `yii\i18n\Formatter::getUnitMessage()` (WinterSilence)
4430
- Bug #19454: Fix PDO exception code not properly passed to `yii\db\Exception` (Roguyt)
31+
- Bug #19462: Fix validator client options to encode HTML tags (bizley)
32+
- Bug #19467: Revert changes in `Inflector::camel2words()` introduced in #19204 (samdark)
33+
- Bug #19469: Fix a virtual relation not working because of new isset checks in `\yii\db\ActiveRelationTrait` (wvanheumen)
34+
- Bug #19471: Enable console commands on hosting with disabled `exec()` function (WinterSilence, lubosdz)
4535
- Bug #19477: Cast shell_exec() output to string (schmunk42)
4636
- Bug #19481: Exception is always empty in ErrorHandler when handling fatal error (Renkas)
47-
- Bug #19462: Fix validator client options to encode HTML tags (bizley)
48-
- Bug #19259: Fix `yii\log\FileTarget` locking and always rotate files only by copy (bizley, mikehaertl)
37+
- Enh #19254: Support specifying custom characters for `yii.validation.trim()` and replace deprecated `jQuery.trim()` (WinterSilence)
38+
- Enh #19270: Replace deprecated `scss` converter in `yii\web\AssetConverter::$commands` (WinterSilence)
39+
- Enh #19295: Add alias `text/rtf` for mime-type `application/rtf` (lesha724)
40+
- Enh #19304: Add filtering validator `yii\validators\TrimValidator` (WinterSilence)
41+
- Enh #19308: Add `yii\web\UploadedFile::$fullPath` represents 'full_path' key added in PHP 8.1 (WinterSilence)
42+
- Enh #19309: Optimize `yii\base\Model::attributes()` (WinterSilence)
43+
- Enh #19318: Add support for typecasting PHP 8.1 enums (EtienneBruines)
44+
- Enh #19384: Normalize `setBodyParams()` and `getBodyParam()` in `yii\web\Request` (WinterSilence, albertborsos)
45+
- Enh #19401: Delay `exit(1)` in `yii\base\ErrorHandler::handleFatalError` (arrilot)
46+
- Enh #19416: Update and improve configurations for `yii\console\controllers\MessageController` (WinterSilence)
47+
- Enh #19420: Update list of JS callbacks in `yii\widgets\MaskedInput` (WinterSilence)
48+
- Enh #19437: Add support to specify request port by trusted proxies in `\yii\web\Request::getServerPort()` (rhertogh)
49+
4950

5051
2.0.45 February 11, 2022
5152
------------------------

Diff for: framework/base/Application.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
* @property-read \yii\rbac\ManagerInterface|null $authManager The auth manager application component or null
1919
* if it's not configured.
2020
* @property string $basePath The root directory of the application.
21-
* @property-read \yii\caching\CacheInterface $cache The cache application component. Null if the component is
22-
* not enabled.
21+
* @property-read \yii\caching\CacheInterface|null $cache The cache application component. Null if the
22+
* component is not enabled.
2323
* @property-write array $container Values given in terms of name-value pairs.
2424
* @property-read \yii\db\Connection $db The database connection.
2525
* @property-read \yii\web\ErrorHandler|\yii\console\ErrorHandler $errorHandler The error handler application

Diff for: framework/base/Model.php

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
* 'Username must contain only word characters.', ], 'email' => [ 'Email address is invalid.', ] ] ``` .
4747
* @property-read array $firstErrors The first errors. The array keys are the attribute names, and the array
4848
* values are the corresponding error messages. An empty array will be returned if there is no error.
49-
* @property-read ArrayIterator $iterator An iterator for traversing the items in the list.
5049
* @property string $scenario The scenario that this model is in. Defaults to [[SCENARIO_DEFAULT]].
5150
* @property-read ArrayObject|\yii\validators\Validator[] $validators All the validators declared in the
5251
* model.

Diff for: framework/console/Controller.php

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
* @property-read string $helpSummary The one-line short summary describing this controller.
3333
* @property-read array $passedOptionValues The properties corresponding to the passed options.
3434
* @property-read array $passedOptions The names of the options passed during execution.
35-
* @property Request $request
36-
* @property Response $response
3735
*
3836
* @author Qiang Xue <[email protected]>
3937
* @since 2.0

Diff for: framework/db/BaseActiveRecord.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
* @property array $oldAttributes The old attribute values (name-value pairs). Note that the type of this
2929
* property differs in getter and setter. See [[getOldAttributes()]] and [[setOldAttributes()]] for details.
3030
* @property-read mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
31-
* returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
32-
* value is null).
31+
* returned if the primary key is composite or `$asArray` is `true`. A string is returned otherwise (null will be
32+
* returned if the key value is null).
3333
* @property-read mixed $primaryKey The primary key value. An array (column name => column value) is returned
34-
* if the primary key is composite. A string is returned otherwise (null will be returned if the key value is
35-
* null).
34+
* if the primary key is composite or `$asArray` is `true`. A string is returned otherwise (null will be returned
35+
* if the key value is null).
3636
* @property-read array $relatedRecords An array of related records indexed by relation names.
3737
*
3838
* @author Qiang Xue <[email protected]>
@@ -1757,7 +1757,7 @@ private function setRelationDependencies($name, $relation, $viaRelationName = nu
17571757

17581758
/**
17591759
* @param string $attribute
1760-
* @param mixed $value
1760+
* @param mixed $value
17611761
* @return bool
17621762
*/
17631763
private function isAttributeDirty($attribute, $value)

Diff for: framework/db/Connection.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,22 @@
110110
* ],
111111
* ```
112112
*
113-
* @property string $driverName Name of the DB driver.
113+
* @property string|null $driverName Name of the DB driver. Note that the type of this property differs in
114+
* getter and setter. See [[getDriverName()]] and [[setDriverName()]] for details.
114115
* @property-read bool $isActive Whether the DB connection is established.
115116
* @property-read string $lastInsertID The row ID of the last row inserted, or the last value retrieved from
116117
* the sequence object.
117-
* @property-read Connection $master The currently active master connection. `null` is returned if there is no
118-
* master available.
118+
* @property-read Connection|null $master The currently active master connection. `null` is returned if there
119+
* is no master available.
119120
* @property-read PDO $masterPdo The PDO instance for the currently active master connection.
120121
* @property QueryBuilder $queryBuilder The query builder for the current DB connection. Note that the type of
121122
* this property differs in getter and setter. See [[getQueryBuilder()]] and [[setQueryBuilder()]] for details.
122123
* @property-read Schema $schema The schema information for the database opened by this connection.
123124
* @property-read string $serverVersion Server version as a string.
124-
* @property-read Connection $slave The currently active slave connection. `null` is returned if there is no
125-
* slave available and `$fallbackToMaster` is false.
126-
* @property-read PDO $slavePdo The PDO instance for the currently active slave connection. `null` is returned
127-
* if no slave connection is available and `$fallbackToMaster` is false.
125+
* @property-read Connection|null $slave The currently active slave connection. `null` is returned if there is
126+
* no slave available and `$fallbackToMaster` is false.
127+
* @property-read PDO|null $slavePdo The PDO instance for the currently active slave connection. `null` is
128+
* returned if no slave connection is available and `$fallbackToMaster` is false.
128129
* @property-read Transaction|null $transaction The currently active transaction. Null if no active
129130
* transaction.
130131
*

Diff for: framework/validators/InlineValidator.php

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/**
1111
* InlineValidator represents a validator which is defined as a method in the object being validated.
1212
*
13-
*
1413
* @author Qiang Xue <[email protected]>
1514
* @since 2.0
1615
*/

Diff for: framework/validators/IpValidator.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
* ['ip_address', 'ip', 'expandIPv6' => true], // expands IPv6 address to a full notation format
3333
* ```
3434
*
35-
* @property array $ranges The IPv4 or IPv6 ranges that are allowed or forbidden. See [[setRanges()]] for
36-
* detailed description. Note that the type of this property differs in getter and setter. See [[getRanges()]]
37-
* and [[setRanges()]] for details.
35+
* @property array $ranges The IPv4 or IPv6 ranges that are allowed or forbidden. Note that the type of this
36+
* property differs in getter and setter. See [[getRanges()]] and [[setRanges()]] for details.
3837
*
3938
* @author Dmitry Naumenko <[email protected]>
4039
* @since 2.0.7

Diff for: framework/validators/Validator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* For more details and usage information on Validator, see the [guide article on validators](guide:input-validation).
5050
*
5151
* @property-read array $attributeNames Attribute names.
52-
* @property-read array $validationAttributes List of attribute names.
52+
* @property-read array|null $validationAttributes List of attribute names.
5353
*
5454
* @author Qiang Xue <[email protected]>
5555
* @since 2.0

Diff for: framework/web/CompositeUrlRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* CompositeUrlRule is the base class for URL rule classes that consist of multiple simpler rules.
1515
*
16-
* @property-read null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call.
16+
* @property-read int|null $createUrlStatus Status of the URL creation after the last [[createUrl()]] call.
1717
* `null` if rule does not provide info about create status.
1818
*
1919
* @author Qiang Xue <[email protected]>

Diff for: framework/web/Controller.php

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
*
1818
* For more details and usage information on Controller, see the [guide article on controllers](guide:structure-controllers).
1919
*
20-
* @property Request $request
21-
* @property Response $response
22-
*
2320
* @author Qiang Xue <[email protected]>
2421
* @since 2.0
2522
*/

Diff for: framework/web/Request.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
* @property-read string|null $authUser The username sent via HTTP authentication, `null` if the username is
3838
* not given.
3939
* @property string $baseUrl The relative URL for the application.
40-
* @property array|object $bodyParams The request parameters given in the request body. Note that the type of
41-
* this property differs in getter and setter. See [[getBodyParams()]] and [[setBodyParams()]] for details.
40+
* @property array|object $bodyParams The request parameters given in the request body.
4241
* @property-read string $contentType Request content-type. Empty string is returned if this information is
4342
* not available.
4443
* @property-read CookieCollection $cookies The cookie collection.
4544
* @property-read string $csrfToken The token used to perform CSRF validation.
46-
* @property-read string $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is
45+
* @property-read string|null $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is
4746
* returned if no such header is sent.
4847
* @property-read array $eTags The entity tags.
4948
* @property-read HeaderCollection $headers The header collection.
@@ -77,7 +76,7 @@
7776
* @property string $scriptFile The entry script file path.
7877
* @property string $scriptUrl The relative URL of the entry script.
7978
* @property int $securePort Port number for secure requests.
80-
* @property-read string $serverName Server name, null if not available.
79+
* @property-read string|null $serverName Server name, null if not available.
8180
* @property-read int|null $serverPort Server port number, null if not available.
8281
* @property string $url The currently requested relative URL. Note that the URI returned may be URL-encoded
8382
* depending on the client.

Diff for: framework/web/UploadedFile.php

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class UploadedFile extends BaseObject
6868
* @var resource|null a temporary uploaded stream resource used within PUT and PATCH request.
6969
*/
7070
private $_tempResource;
71-
7271
/**
7372
* @var array[]
7473
*/

Diff for: framework/web/UrlRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* ]
2525
* ```
2626
*
27-
* @property-read null|int $createUrlStatus Status of the URL creation after the last [[createUrl()]] call.
27+
* @property-read int|null $createUrlStatus Status of the URL creation after the last [[createUrl()]] call.
2828
* `null` if rule does not provide info about create status.
2929
*
3030
* @author Qiang Xue <[email protected]>

Diff for: framework/web/User.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
* ]
4848
* ```
4949
*
50-
* @property-read string|int $id The unique identifier for the user. If `null`, it means the user is a guest.
50+
* @property-read string|int|null $id The unique identifier for the user. If `null`, it means the user is a
51+
* guest.
5152
* @property IdentityInterface|null $identity The identity object associated with the currently logged-in
5253
* user. `null` is returned if the user is not logged in (not authenticated).
5354
* @property-read bool $isGuest Whether the current user is a guest.

0 commit comments

Comments
 (0)