HadyShaltout right, in this case, instance() is better to be annotated (either with PHPDoc @return DB_Helper or with return type function instance() : DB_Helper.
I'll note this use case and in the future update, we may infer the type automatically. For now, the annotation is necessary.
As of HRESULT E_FAIL - I'm still not sure why it's happening for you. Is it only when (re)opening the project?