new(xlvask_tasks::class); */ public function new(string $class): xlvask_vehicle_types|xlvask_vehicle_type|xlvask_vehicle|xlvask_create_customer|xlvask_wash_item|xlvask_usage_log|xlvask_customer|xlvask_cache|xlvask_tasks|xlvask_guid|xlvask_vehicles|xlvask_helper { if (class_exists($class)) { // Check if the class is a subclass of xlvask_helper if (!is_subclass_of($class, xlvask_helper::class)) { throw new \Exception("Class $class must extend xlvask_helper."); } return new $class(); } else { throw new \Exception("Class $class does not exist."); } } }