Skip to content

Commit 61f1bd7

Browse files
authored
Fix @var annotations (#20517)
1 parent 53256fd commit 61f1bd7

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

framework/db/ActiveQuery.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ public function populate($rows)
266266
private function removeDuplicatedModels($models)
267267
{
268268
$hash = [];
269-
/** @var ActiveRecord $class */
269+
/**
270+
* @var ActiveRecord
271+
* @phpstan-var class-string<ActiveRecord>
272+
*/
270273
$class = $this->modelClass;
271274
$pks = $class::primaryKey();
272275

framework/db/ActiveRelationTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ private function populateInverseRelation(&$primaryModels, $models, $primaryName,
339339
return;
340340
}
341341
$model = reset($models);
342-
/** @var ActiveQueryInterface|ActiveQuery $relation */
343342
if ($model instanceof ActiveRecordInterface) {
344343
$relation = $model->getRelation($name);
345344
} else {
@@ -348,6 +347,7 @@ private function populateInverseRelation(&$primaryModels, $models, $primaryName,
348347
$relation = $modelClass::instance()->getRelation($name);
349348
}
350349

350+
/** @var ActiveQueryInterface|ActiveQuery $relation */
351351
if ($relation->multiple) {
352352
$buckets = $this->buildBuckets($primaryModels, $relation->link, null, null, false);
353353
if ($model instanceof ActiveRecordInterface) {

framework/requirements/YiiRequirementChecker.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@
4949
* Note: this class definition does not match ordinary Yii style, because it should match PHP 4.3
5050
* and should not use features from newer PHP versions!
5151
*
52-
* @property array|null $result the check results, this property is for internal usage only.
53-
*
5452
* @author Paul Klimov <[email protected]>
5553
* @since 2.0
5654
*/
5755
class YiiRequirementChecker
5856
{
5957
/**
60-
* @var Check result
58+
* @var array|null the check results, this property is for internal usage only.
6159
*/
6260
public $result;
6361

framework/web/User.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,10 @@ protected function getIdentityAndDurationFromCookie()
626626
$data = json_decode($value, true);
627627
if (is_array($data) && count($data) == 3) {
628628
list($id, $authKey, $duration) = $data;
629-
/** @var IdentityInterface $class */
629+
/**
630+
* @var IdentityInterface
631+
* @phpstan-var class-string<IdentityInterface>
632+
*/
630633
$class = $this->identityClass;
631634
$identity = $class::findIdentity($id);
632635
if ($identity !== null) {

0 commit comments

Comments
 (0)