mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-28 04:25:53 +08:00
Fix @var annotations (#20517)
This commit is contained in:
@ -266,7 +266,10 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
|||||||
private function removeDuplicatedModels($models)
|
private function removeDuplicatedModels($models)
|
||||||
{
|
{
|
||||||
$hash = [];
|
$hash = [];
|
||||||
/** @var ActiveRecord $class */
|
/**
|
||||||
|
* @var ActiveRecord
|
||||||
|
* @phpstan-var class-string<ActiveRecord>
|
||||||
|
*/
|
||||||
$class = $this->modelClass;
|
$class = $this->modelClass;
|
||||||
$pks = $class::primaryKey();
|
$pks = $class::primaryKey();
|
||||||
|
|
||||||
|
|||||||
@ -339,7 +339,6 @@ trait ActiveRelationTrait
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$model = reset($models);
|
$model = reset($models);
|
||||||
/** @var ActiveQueryInterface|ActiveQuery $relation */
|
|
||||||
if ($model instanceof ActiveRecordInterface) {
|
if ($model instanceof ActiveRecordInterface) {
|
||||||
$relation = $model->getRelation($name);
|
$relation = $model->getRelation($name);
|
||||||
} else {
|
} else {
|
||||||
@ -348,6 +347,7 @@ trait ActiveRelationTrait
|
|||||||
$relation = $modelClass::instance()->getRelation($name);
|
$relation = $modelClass::instance()->getRelation($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var ActiveQueryInterface|ActiveQuery $relation */
|
||||||
if ($relation->multiple) {
|
if ($relation->multiple) {
|
||||||
$buckets = $this->buildBuckets($primaryModels, $relation->link, null, null, false);
|
$buckets = $this->buildBuckets($primaryModels, $relation->link, null, null, false);
|
||||||
if ($model instanceof ActiveRecordInterface) {
|
if ($model instanceof ActiveRecordInterface) {
|
||||||
|
|||||||
@ -49,15 +49,13 @@ if (version_compare(PHP_VERSION, '4.3', '<')) {
|
|||||||
* Note: this class definition does not match ordinary Yii style, because it should match PHP 4.3
|
* Note: this class definition does not match ordinary Yii style, because it should match PHP 4.3
|
||||||
* and should not use features from newer PHP versions!
|
* and should not use features from newer PHP versions!
|
||||||
*
|
*
|
||||||
* @property array|null $result the check results, this property is for internal usage only.
|
|
||||||
*
|
|
||||||
* @author Paul Klimov <klimov.paul@gmail.com>
|
* @author Paul Klimov <klimov.paul@gmail.com>
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
class YiiRequirementChecker
|
class YiiRequirementChecker
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Check result
|
* @var array|null the check results, this property is for internal usage only.
|
||||||
*/
|
*/
|
||||||
public $result;
|
public $result;
|
||||||
|
|
||||||
|
|||||||
@ -626,7 +626,10 @@ class User extends Component
|
|||||||
$data = json_decode($value, true);
|
$data = json_decode($value, true);
|
||||||
if (is_array($data) && count($data) == 3) {
|
if (is_array($data) && count($data) == 3) {
|
||||||
list($id, $authKey, $duration) = $data;
|
list($id, $authKey, $duration) = $data;
|
||||||
/** @var IdentityInterface $class */
|
/**
|
||||||
|
* @var IdentityInterface
|
||||||
|
* @phpstan-var class-string<IdentityInterface>
|
||||||
|
*/
|
||||||
$class = $this->identityClass;
|
$class = $this->identityClass;
|
||||||
$identity = $class::findIdentity($id);
|
$identity = $class::findIdentity($id);
|
||||||
if ($identity !== null) {
|
if ($identity !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user