<?php
namespace Pmag\ApiBundle\Action\EntryPoint;
use Pmag\ApiBundle\Action\BaseAction;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
/**
* EntryPoint
* @package Pmag\ApiBundle\Action\EntryPoint
* @author Daly Ala <rafin_ala03@hotmail.fr>
**/
class EntryPoint extends BaseAction
{
/**
* Redirect to documentation if dev env
*
* @Route(name="entry_point", path="/")
*/
public function __invoke()
{
if (in_array($this->getParameter('kernel.environment'), ['prod', 'test'])) {
throw new NotFoundHttpException();
}
return $this->redirectToRoute('app.swagger_ui');
}
}