editTask() public static method

Edit and save TaskInterface object
public static editTask ( mult1mate\crontab\TaskInterface $task, string $time, string $command, string $status = TaskInterface::TASK_STATUS_ACTIVE, string $comment = null ) : mult1mate\crontab\TaskInterface
$task mult1mate\crontab\TaskInterface
$time string
$command string
$status string
$comment string
return mult1mate\crontab\TaskInterface
 public function testEditTask()
 {
     $task = TaskMock::createNew();
     $command = 'ActionMock::method()';
     $task = TaskManager::editTask($task, '* * * * *', $command, TaskInterface::TASK_STATUS_ACTIVE, 'comment');
     $this->assertEquals($command, $task->getCommand());
     $command = 'wrong_command';
     $task = TaskManager::editTask($task, '* * * * *', $command, TaskInterface::TASK_STATUS_ACTIVE, 'comment');
     $this->assertNotEquals($command, $task->getCommand());
 }
 public function taskEdit()
 {
     if (isset($_GET['task_id'])) {
         $task = Task::find($_GET['task_id']);
     } else {
         $task = new Task();
     }
     /**
      * @var Task $task
      */
     if (!empty($_POST)) {
         $task = TaskManager::editTask($task, $_POST['time'], $_POST['command'], $_POST['status'], $_POST['comment']);
     }
     $this->renderView('task_edit', array('task' => $task, 'methods' => TaskLoader::getAllMethods(self::$tasks_controllers_folder)));
 }
 public function taskEdit()
 {
     if (isset($_GET['task_id'])) {
         $task = Task::findByPk($_GET['task_id']);
     } else {
         $task = Task::createNew();
     }
     /**
      * @var Task $task
      */
     if (!empty($_POST)) {
         $task = TaskManager::editTask($task, $_POST['time'], $_POST['command'], $_POST['status'], $_POST['comment']);
     }
     $this->load->view('tasks/task_edit', array('task' => $task, 'methods' => TaskLoader::getAllMethods($this->controller_folder)));
 }
 public function actionTaskEdit()
 {
     if (isset($_GET['task_id'])) {
         $task = Task::findOne($_GET['task_id']);
     } else {
         $task = new Task();
     }
     /**
      * @var Task $task
      */
     $post = \Yii::$app->request->post();
     if ($task->load($post) && $task->validate()) {
         $task = TaskManager::editTask($task, $post['Task']['time'], $post['Task']['command'], $post['Task']['status'], $post['Task']['comment']);
         \Yii::$app->response->redirect('/?r=tasks/task-edit&task_id=' . $task->task_id);
     }
     return $this->render('task_edit', array('task' => $task, 'methods' => TaskLoader::getAllMethods(self::$tasks_controllers_folder, self::$tasks_namespace)));
 }