<?php

namespace Trq\TodoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Trq\TodoBundle\Entity\Todo;

class TodoController extends Controller
{
    /**
     * getTodosAction
     *
     * @access public
     * @return void
     */
    public function getTodosAction()
    {
        $todos = $this->getDoctrine()
            ->getRepository('TrqTodoBundle:Todo')
            ->findAll();

        return ['todos' => $todos];
    }

    /**
     * getTodoAction
     *
     * @param mixed $todo
     * @access public
     * @return void
     */
    public function getTodoAction(Todo $todo)
    {
        return ['todo' => $todo];
    }
}

<?php

namespace Trq\TodoBundle\Controller;

use FOS\RestBundle\View\View;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Trq\TodoBundle\Entity\Todo;

class TodoController extends Controller
{
    /**
     * getTodosAction
     *
     * @access public
     * @return void
     */
    public function getTodosAction()
    {
        $todos = $this->getDoctrine()
            ->getRepository('TrqTodoBundle:Todo')
            ->findAll();

        $view = View::create();
        $view->setData(['todos' => $todos]);
        return $view;
    }

    /**
     * getTodoAction
     *
     * @param mixed $todo
     * @access public
     * @return void
     */
    public function getTodoAction(Todo $todo)
    {
        return ['todo' => $todo];
    }
}

--- 
+++ 
@@ -2,7 +2,6 @@
 
 namespace Trq\TodoBundle\Controller;
 
-use FOS\RestBundle\View\View;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Trq\TodoBundle\Entity\Todo;
 
@@ -20,9 +19,7 @@
             ->getRepository('TrqTodoBundle:Todo')
             ->findAll();
 
-        $view = View::create();
-        $view->setData(['todos' => $todos]);
-        return $view;
+        return ['todos' => $todos];
     }
 
     /**
Remove the View stuff, FOSRest handles this via listeners.
