I have
abstract class A{
public static function getSingle($where = []) {
$classname = get_called_class();
$record = static::turnTheWhereIntoArecordFromDB($where);
$model = new $classname($record);
return $model;
}
}
class B extends A{
}
$x = B::getSingle();
$x has no type hinting... I like type hinting, so I want type hinting for B, not for A
How to enable type hinting directly for $x?
what I thought is something like
public function getSingle($where = []) : ?get_called_class()
This obviously doesn't work
Is there something that does?