public static function get_instance($task, $values) { // If the singleton isn't set or if the task is another one, create new instance if (!isset(self::$instance) || self::$task !== $task) { self::$task = $task; self::$instance = new restore_logs_processor($values); } return self::$instance; }