-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#4122Description
Bug report
<?php
declare(strict_types = 1);
/**
* @template TScalar of scalar
*/
abstract class ScalarType {
/**
* @return class-string<ScalarType<TScalar>>
*/
abstract public static function getClassIdentify() : string;
}
/**
* @extends ScalarType<int>
*/
class MyInt extends ScalarType {
public static function getClassIdentify() : string {
return MyInt::class;
}
}
/**
* @extends ScalarType<string>
*/
class MyString extends ScalarType {
public static function getClassIdentify() : string {
return MyString::class;
}
}
/**
* @extends ScalarType<lowercase-string>
*/
class MyLowerString extends ScalarType {
public static function getClassIdentify() : string {
return MyLowerString::class;
}
}
/**
* @extends ScalarType<class-string>
*/
class MyClassString extends ScalarType {
public static function getClassIdentify() : string {
return MyClassString::class;
}
}
Like class-string it should work for lowercase-string.
Code snippet that reproduces the problem
https://phpstan.org/r/65c1fbbb-16e8-468c-beeb-ec5374580347
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is one of the best tools I ever seen.
Reactions are currently unavailable

