for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kuleuven\AuthenticationBundle\Controller;
use Kuleuven\AuthenticationBundle\Service\ShibbolethServiceProvider;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Templating\EngineInterface;
class DefaultController
{
/**
* @var ShibbolethServiceProvider
*/
protected $shibbolethServiceProvider;
* @var EngineInterface
protected $templating;
* @var bool
protected $debug;
* @param ShibbolethServiceProvider $shibbolethServiceProvider
* @param EngineInterface $templating
* @param boolean $debug
public function __construct(ShibbolethServiceProvider $shibbolethServiceProvider, EngineInterface $templating, $debug)
$this->shibbolethServiceProvider = $shibbolethServiceProvider;
$this->templating = $templating;
$this->debug = $debug;
}
* @return Response
* @throws UnauthorizedHttpException
public function indexAction()
if (!$this->debug) {
throw new UnauthorizedHttpException('Only available in debug mode.');
$response = new Response();
$response->setContent($this->templating->render('KuleuvenAuthenticationBundle:Default:index.html.twig', [
'attributes' => $this->shibbolethServiceProvider->getAttributes(),
]));
return $response;