parseCrontab() public static method

Parses each line of crontab content and creates new TaskInterface objects
public static parseCrontab ( string $cron, mult1mate\crontab\TaskInterface $task_class ) : array
$cron string
$task_class mult1mate\crontab\TaskInterface
return array
 public function parseCrontab()
 {
     if (isset($_POST['crontab'])) {
         $result = TaskManager::parseCrontab($_POST['crontab'], new Task());
         echo json_encode($result);
     }
 }
 public function parseCrontab()
 {
     if (isset($_POST['crontab'])) {
         $result_summon = $tasks = array();
         $result = TaskManager::parseCrontab($_POST['crontab'], new Task());
         foreach ($result as $r) {
             $result_summon[$r[1]] = isset($result_summon[$r[1]]) ? $result_summon[$r[1]] + 1 : 1;
             if (isset($r[2]) && is_object($r[2])) {
                 $task = $r[2];
                 /**
                  * @var Task $task
                  */
                 $tasks[] = '#' . $task->getComment() . '<br>' . $task->getTime() . ' ' . $task->getCommand();
             }
         }
         echo '<h3>Results</h3>
             <b>';
         foreach ($result_summon as $value => $count) {
             echo $value . ': ' . $count . '<br>';
         }
         if (!empty($tasks)) {
             echo '<h4>Saved tasks</h4>';
         }
         echo '</b><code>' . implode('<hr>', $tasks) . '</code><hr>';
         echo '<h4>Not saved lines</h4>';
         foreach ($result as $r) {
             if (in_array($r[1], array('Not matched', 'Time expression is not valid'))) {
                 echo '<b>' . $r[1] . '</b><br>' . $r[0] . '<br>';
             }
         }
     }
 }
 public function testParseCrontab()
 {
     $task = TaskMock::createNew();
     $cron = '
     #comment
     * * * * * cd path/; /usr/bin/php index.php controller method args 2>&1 > /dev/null
     * * * * -1 cd path/; /usr/bin/php index.php controller method args 2>&1 > /dev/null
     * * * * * cd path/; wrong expression';
     TaskManager::parseCrontab($cron, $task);
 }