Fix @var tags syntax in base, behaviors and caching folder (#20390)

This commit is contained in:
Максим Спирков
2025-05-31 10:47:14 +04:00
committed by GitHub
parent 2303d72238
commit cde05962bf
10 changed files with 18 additions and 18 deletions

View File

@ -118,7 +118,7 @@ class OptimisticLockBehavior extends AttributeBehavior
return $this->_lockAttribute;
}
/* @var $owner BaseActiveRecord */
/** @var BaseActiveRecord $owner */
$owner = $this->owner;
$lock = $owner->optimisticLock();
if ($lock === null || $owner->hasAttribute($lock) === false) {
@ -159,7 +159,7 @@ class OptimisticLockBehavior extends AttributeBehavior
*/
public function upgrade()
{
/* @var $owner BaseActiveRecord */
/** @var BaseActiveRecord $owner */
$owner = $this->owner;
if ($owner->getIsNewRecord()) {
throw new InvalidCallException('Upgrading the model version is not possible on a new record.');

View File

@ -239,8 +239,7 @@ class SluggableBehavior extends AttributeBehavior
*/
protected function validateSlug($slug)
{
/* @var $validator UniqueValidator */
/* @var $model BaseActiveRecord */
/** @var UniqueValidator $validator */
$validator = Yii::createObject(array_merge(
[
'class' => UniqueValidator::className(),
@ -248,6 +247,7 @@ class SluggableBehavior extends AttributeBehavior
$this->uniqueValidator
));
/** @var BaseActiveRecord $model */
$model = clone $this->owner;
$model->clearErrors();
$model->{$this->slugAttribute} = $slug;

View File

@ -131,7 +131,7 @@ class TimestampBehavior extends AttributeBehavior
*/
public function touch($attribute)
{
/* @var $owner BaseActiveRecord */
/** @var BaseActiveRecord $owner */
$owner = $this->owner;
if ($owner->getIsNewRecord()) {
throw new InvalidCallException('Updating the timestamp is not possible on a new record.');