Use array_get to get current class

PHP throws a warning for undefined index:class when no classes are passed.