mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fix @var tags syntax in base, behaviors and caching folder (#20390)
This commit is contained in:
@ -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.');
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user