PHPStan / LaraStan - Model event - Static call to instance method error
Hi everyone,
I'm planning to implement PHPStan / LaraStan into our projects. However, I face a Static call to instance method error for every Model boot event and I don't find how to solve this.
Here is the code triggering the issue
class Node extends AbstractModel
{
use SoftDeletes;
use TimeStampsBy;
use SoftDeletesBy;
protected $fillable = [
'name',
// ...
];
protected $hidden = [
'created_at',
'updated_at',
'deleted_at',
'created_by',
'updated_by',
'deleted_by',
];
public static function boot()
{
parent::boot();
/**
* Ensure active property is set to 1 when creating a Node
*/
static::creating(function (Node $model) {
$model->active = 1;
});
// ...
}
Thx to everyone in the willing to answer that question... ;)
It’s not solving your problem but you could include it and start by adding it to the baseline, allow errors pr lower the level. This Will, get you started and you Can improve it when you get more experince with it.
That would at least help improve other potential improvements.