function loadTasks(string $namespace, $tasks) {
        if (!is_array($tasks))
            $tasks = [$tasks];
        foreach ($tasks as &$task) {
            $class_name = $namespace.$task;
            if (!is_subclass_of($class_name, '\\Acast\\CronService\\TaskInterface')) {
                Console::warning("Invalid class \"$task\".");
                continue;
            }
            $this->addTask($class_name::init());
        }
    }
function loadTasks(string $namespace, $tasks) {
        if (!is_array($tasks))
            $tasks = [$tasks];
        foreach ($tasks as &$task) {
            $class_name = $namespace.$task;
            if (!is_subclass_of($class_name, '\\Acast\\CronService\\TaskInterface')) {
                Console::warning("Invalid class \"$task\".");
                continue;
            }
            $this->addTask($class_name::init());
        }
    }
function loadTasks ( string $ namespace , $ tasks ) { if ( ! is_array ( $ tasks ) ) $ tasks = [ $ tasks ] ; foreach ( $ tasks as & $ task ) { $ class_name = $ namespace . $ task ; if ( ! is_subclass_of ( $ class_name , '\\Acast\\CronService\\TaskInterface' ) ) { Console :: warning ( "Invalid class \"$task\"." ) ; continue ; } $ this -> addTask ( $ class_name :: init ( ) ) ; } }
Load tasks by namespace and class name.

@param string $namespace
@param mixed $tasks
Load tasks by namespace and class name .