for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace VSV\GVQ_API\Question\Controllers;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use VSV\GVQ_API\Question\Repositories\QuestionRepository;
class QuestionViewController extends AbstractController
{
/**
* @var QuestionRepository
*/
private $questionRepository;
* @param QuestionRepository $questionRepository
public function __construct(QuestionRepository $questionRepository)
$this->questionRepository = $questionRepository;
}
* @return Response
public function index(): Response
$questions = $this->questionRepository->getAll();
return $this->render(
'questions/index.html.twig',
[
'questions' => $questions ? $questions->toArray() : [],
]
);