Improve getting namespaced class name.
Merge pull request #3996 from ADmad/3.0-viewvarstrait

Improve getting namespaced class name.