src/Controller/TaskRunnerController.php
private function convertTaskToArray(Task $task, $addOutput = false, $outputOffset = null)
    {
        $data = [
            'id'         => $task->getId(),
            'status'     => $task->getStatus(),
            'type'       => $task->getType(),
            'created_at' => $task->getCreatedAt()->format(\DateTime::ISO8601),
            'user_data'  => $task->getUserData()
        ];

        if (true === $addOutput) {
            $data['output'] = $task->getOutput($outputOffset);
        }

        return $data;
    }
private function convertTaskToArray(Task $task, $addOutput = false, $outputOffset = null)
    {
        $data = [
            'id'         => $task->getId(),
            'status'     => $task->getStatus(),
            'type'       => $task->getType(),
            'created_at' => $task->getCreatedAt()->format(\DateTime::ISO8601),
            'user_data'  => $task->getUserData()
        ];

        if (true === $addOutput) {
            $data['output'] = $task->getOutput($outputOffset);
        }

        return $data;
    }
private function convertTaskToArray ( Task $ task , $ addOutput = false , $ outputOffset = null ) { $ data = [ 'id' => $ task -> getId ( ) , 'status' => $ task -> getStatus ( ) , 'type' => $ task -> getType ( ) , 'created_at' => $ task -> getCreatedAt ( ) -> format ( \ DateTime :: ISO8601 ) , 'user_data' => $ task -> getUserData ( ) ] ; if ( true === $ addOutput ) { $ data [ 'output' ] = $ task -> getOutput ( $ outputOffset ) ; } return $ data ; }
Convert a task to an array.

@param Task $task         The task to convert.

@param bool $addOutput    Flag determining if the output shall get added or not.

@param null $outputOffset The output offset to use.

@return array
Convert a task to an array .