PHPStan crashing when I use static type in relation, for example: recursive category with same parent type:
class` Category extends ActiveRecord
{
public function getParent(): ActiveQuery
{
return $this->hasOne(static::class, ['id' => 'parent_id']);
}
}
And I got error:
Line common/components/category/models/Category.php
------ --------------------------------------------------------------
Internal error: Invalid argument provided to method hasOne
Hint: You should use ::class instead of ::className()
Run PHPStan with --debug option and post the stack trace to:
https://github.com/phpstan/phpstan/issues/new
-- -------------------------------------------------------------------------------------------------
Error
-- -------------------------------------------------------------------------------------------------
Error message "Internal error: Invalid argument provided to method hasOne
Hint: You should use ::class instead of ::className()
Run PHPStan with --debug option and post the stack trace to:
https://github.com/phpstan/phpstan/issues/new" cannot be ignored, use excludes_analyse instead.
-- -------------------------------------------------------------------------------------------------
[ERROR] Found 1 errors
I use last version of proget-hq/phpstan-yii2 on current date.
PHPStan crashing when I use static type in relation, for example: recursive category with same parent type:
And I got error:
I use last version of proget-hq/phpstan-yii2 on current date.