-
-
Notifications
You must be signed in to change notification settings - Fork 928
Closed
phpstan/phpstan-src
#1271Labels
Milestone
Description
Bug report
Seems same as #3263 but for ::class
instead of get_class()
<?php declare(strict_types = 1);
class Model {
}
/**
* @template TModel of Model
*/
class ModelHelper {
/**
* @var TModel
*/
private Model $model;
/**
* @param TModel $model
*/
public function __construct(Model $model) {
$this->model = $model;
}
/**
* @return class-string<TModel>
*/
public function bug(): string {
// Method ModelHelper::bug() should return class-string<TModel of Model> but returns class-string<Model>.
return $this->model::class;
}
}
Code snippet that reproduces the problem
(https://phpstan.org/r/6cfdf3cf-423e-45d4-b86c-7664ada4eccb)
Expected output
no error
Did PHPStan help you today? Did it make you happy in any way?
Yep, I've found missed method call 🙈