This commit is contained in:
Benoît Burnichon
2016-01-19 15:30:11 +01:00
parent bbcdb5ff31
commit 6fb295b6b9
3 changed files with 14 additions and 14 deletions

View File

@@ -10,6 +10,7 @@
namespace Alchemy\Phrasea\Application\Helper;
use Alchemy\Phrasea\Http\DeliverDataInterface;
use Symfony\Component\HttpFoundation\Response;
trait DelivererAware
{
@@ -62,6 +63,7 @@ trait DelivererAware
* @param string $disposition
* @param string|null $mimeType
* @param integer $cacheDuration
* @return Response
*/
public function deliverFile($file, $filename = null, $disposition = DeliverDataInterface::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = null)
{
@@ -76,6 +78,7 @@ trait DelivererAware
* @param string $mimeType
* @param string $disposition
* @param integer $cacheDuration
* @return Response
*/
public function deliverData($data, $filename, $mimeType, $disposition = DeliverDataInterface::DISPOSITION_INLINE, $cacheDuration = null)
{

View File

@@ -11,6 +11,7 @@
namespace Alchemy\Phrasea\Http;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
interface DeliverDataInterface
@@ -26,6 +27,7 @@ interface DeliverDataInterface
* @param string $disposition
* @param string|null $mimeType
* @param integer $cacheDuration
* @return Response
*/
public function deliverFile($file, $filename = null, $disposition = self::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = null);
@@ -37,6 +39,7 @@ interface DeliverDataInterface
* @param string $mimeType
* @param string $disposition
* @param integer $cacheDuration
* @return Response
*/
public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = null);
}

View File

@@ -23,9 +23,6 @@ class ServeFileResponseFactory implements DeliverDataInterface
$this->unicode = $unicode;
}
/**
* {@inheritdoc}
*/
public function deliverFile($file, $filename = '', $disposition = self::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = null)
{
$response = new BinaryFileResponse($file);
@@ -41,9 +38,6 @@ class ServeFileResponseFactory implements DeliverDataInterface
return $response;
}
/**
* {@inheritdoc}
*/
public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = null)
{
$response = new Response($data);