<?php

namespace limble\helpers;

class limble_tasks
{
    /**
     * Format an array of tasks into an array of limble_task objects
     * @param array $tasks
     * @return limble_task[]
     * @see limble_task
     */
    public function formatTasks(array $tasks): array
    {
        $formattedTasks = [];
        foreach ( $tasks as $task ) {
            $formattedTasks[] = $this->formatTask($task);
        }
        return $formattedTasks;
    }

    /**
     * Format a task array into a limble_task object
     * @param array $task
     * @return limble_task
     * @see limble_task
     */
    public function formatTask(array $task): limble_task
    {
        return new limble_task($task);
    }
}