src/Controller/ApiVolleyController.php line 120

  1. <?php
  2. namespace App\Controller;
  3. use App\Services\ApiVolley\ApiVolleyManager;
  4. use Doctrine\ORM\NonUniqueResultException;
  5. use http\Client\Response;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Component\HttpFoundation\JsonResponse;
  9. use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
  10. use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
  11. use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
  12. use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
  13. use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
  14. class ApiVolleyController extends AbstractController
  15. {
  16.     private ApiVolleyManager $grubVolleyManager;
  17.     public function __construct(
  18.         ApiVolleyManager $grubVolleyManager
  19.     )
  20.     {
  21.         $this->grubVolleyManager $grubVolleyManager;
  22.     }
  23.     /**
  24.      * @return array
  25.      * @throws ClientExceptionInterface
  26.      * @throws DecodingExceptionInterface
  27.      * @throws RedirectionExceptionInterface
  28.      * @throws ServerExceptionInterface
  29.      * @throws TransportExceptionInterface
  30.      */
  31.     public function grubTournaments(): JsonResponse
  32.     {
  33.         return $this->grubVolleyManager->fillTournaments();
  34.     }
  35.     /**
  36.      * @throws ClientExceptionInterface
  37.      * @throws DecodingExceptionInterface
  38.      * @throws RedirectionExceptionInterface
  39.      * @throws ServerExceptionInterface
  40.      * @throws TransportExceptionInterface
  41.      */
  42.     public function grubTournamentGames(): JsonResponse
  43.     {
  44.         return $this->grubVolleyManager->grubTournamentGames();
  45.     }
  46.     /**
  47.      * @return JsonResponse
  48.      * @throws ClientExceptionInterface
  49.      * @throws DecodingExceptionInterface
  50.      * @throws RedirectionExceptionInterface
  51.      * @throws ServerExceptionInterface
  52.      * @throws TransportExceptionInterface
  53.      */
  54.     public function grubGames(): JsonResponse
  55.     {
  56.         return  $this->grubVolleyManager->grubGames();
  57.     }
  58.     /**
  59.      * @return JsonResponse
  60.      */
  61.     public function grubGame(): JsonResponse
  62.     {
  63.         return  $this->grubVolleyManager->grubGame("01H7W6JFTCNW9P04WCF7HH1ZP7");
  64.     }
  65.     /**
  66.      * @return JsonResponse
  67.      * @throws ClientExceptionInterface
  68.      * @throws DecodingExceptionInterface
  69.      * @throws RedirectionExceptionInterface
  70.      * @throws ServerExceptionInterface
  71.      * @throws TransportExceptionInterface
  72.      */
  73.     public function grubPlayers(): JsonResponse
  74.     {
  75.         return $this->grubVolleyManager->grubPlayers();
  76.     }
  77.     /**
  78.      * @return JsonResponse
  79.      * @throws DecodingExceptionInterface
  80.      * @throws TransportExceptionInterface
  81.      */
  82.     public function grubPlayer(): JsonResponse
  83.     {
  84.         return $this->grubVolleyManager->grubPlayer("01FPWFJKJCGDXW1WK5CF0E1FBA");
  85.     }
  86.     /**
  87.      * @return JsonResponse
  88.      * @throws ClientExceptionInterface
  89.      * @throws DecodingExceptionInterface
  90.      * @throws RedirectionExceptionInterface
  91.      * @throws ServerExceptionInterface
  92.      * @throws TransportExceptionInterface
  93.      */
  94.     public function grubTeams(): JsonResponse
  95.     {
  96.         return $this->grubVolleyManager->grubTeams();
  97.     }
  98.     /**
  99.      * @return JsonResponse
  100.      * @throws ClientExceptionInterface
  101.      * @throws DecodingExceptionInterface
  102.      * @throws NonUniqueResultException
  103.      * @throws RedirectionExceptionInterface
  104.      * @throws ServerExceptionInterface
  105.      * @throws TransportExceptionInterface
  106.      */
  107.     public function grubScore(): JsonResponse
  108.     {
  109.        return $this->grubVolleyManager->grubScore();
  110.     }
  111. }