api/ApiBundle/Action/EntryPoint/EntryPoint.php line 16

Open in your IDE?
  1. <?php
  2. namespace Pmag\ApiBundle\Action\EntryPoint;
  3. use Pmag\ApiBundle\Action\BaseAction;
  4. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. /**
  7.  * EntryPoint
  8.  * @package Pmag\ApiBundle\Action\EntryPoint
  9.  * @author Daly Ala <rafin_ala03@hotmail.fr>
  10.  **/
  11. class EntryPoint extends BaseAction
  12. {
  13.     /**
  14.      * Redirect to documentation if dev env
  15.      *
  16.      * @Route(name="entry_point", path="/")
  17.      */
  18.     public function __invoke()
  19.     {
  20.         if (in_array($this->getParameter('kernel.environment'), ['prod''test'])) {
  21.             throw new NotFoundHttpException();
  22.         }
  23.         return $this->redirectToRoute('app.swagger_ui');
  24.     }
  25. }