for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MediaMonks\SonataMediaBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class MediaController extends Controller
{
/**
* @param Request $request
* @param int $id
* @param int $width
* @param int $height
* @return RedirectResponse
*/
public function imageRedirectAction(Request $request, $id, $width, $height)
$media = $this->getDoctrine()->getManager()->find('MediaMonksSonataMediaBundle:Media', $id);
return $this->get('mediamonks.sonata_media.utility.image')->getRedirectResponse($media, $width, $height, $request->query->all());
}
* @param $id
* @return StreamedResponse
public function downloadAction(Request $request, $id)
$request
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return $this->get('mediamonks.sonata_media.utility.download')->getStreamedResponse($media);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.