protected function createClass($className, $args)
    {
        if ($args === null) {
            return new $className;
        }
        if (!is_array($args)) {
            return new $className($args);
        }
        if (count(array_filter(array_keys($args), 'is_string')) > 0) {
            return new $className($args);
        } else {
            /**
             * @todo Use argument unpacking (`return new $className(...$args);`)
             *     when minimum PHP requirement is bumped to 5.6.
             */
            $reflection = new ReflectionClass($className);
            return $reflection->newInstanceArgs($args);
        }
    }