magnetico-web/src/Controller/MagnetRedirectController.php

15 lines
387 B
PHP

<?php
namespace App\Controller;
use App\Magnet\MagnetGenerator;
use Symfony\Component\HttpFoundation\RedirectResponse;
class MagnetRedirectController
{
public function redirect(string $infoHash, MagnetGenerator $magnetGenerator): RedirectResponse
{
return new RedirectResponse($magnetGenerator->generate($infoHash), RedirectResponse::HTTP_TEMPORARY_REDIRECT);
}
}