for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace tuyakhov\notifications\models;
use tuyakhov\notifications\behaviors\ReadableBehavior;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
use yii\db\Expression;
/**
* Database notification model
* @property $level string
* @property $subject string
* @property $notifiable_type string
* @property $notifiable_id int
* @property $body string
* @property $read_at string
* @property $notifiable
* @method void markAsRead()
* @method void markAsUnread()
* @method bool read()
* @method bool unread()
*/
$level
0
class Notification extends ActiveRecord
{
* @inheritdoc
public function rules()
return [
[['level', 'notifiable_type', 'subject', 'body'], 'string'],
['notifiable_id', 'integer'],
];
}
public function behaviors()
[
'class' => TimestampBehavior::className(),
yii\base\BaseObject::className()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
'class' => /** @scrutinizer ignore-deprecated */ TimestampBehavior::className(),
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
'value' => new Expression('NOW()'),
],
ReadableBehavior::className()
/** @scrutinizer ignore-deprecated */ ReadableBehavior::className()
public function getNotifiable()
return $this->hasOne($this->notifiable_type, ['id' => 'notifiable_id']);
notifiable_type
tuyakhov\notifications\models\Notification
__get