interface IUser {
public static function getById($id): IUser;
}
interface IAdmin extends IUser { }
class UserEntity implements IUser {
public static function getById($id): IUser {
return new static();
}
}
class AdminEntity extends UserEntity implements IAdmin {
public function someMethod(): IAdmin {
return self::getById();
}
}