Fix use of __CLASS__ when not in class
Merge pull request #4049 from thenbrent/fix_deprecated_class

Fix use of `__CLASS__` when not in class