diff --git a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php index db97887c76..ab651780bd 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php @@ -14,12 +14,11 @@ namespace Alchemy\Phrasea\Core\Provider; use Alchemy\Phrasea\Core\Event\Subscriber\XSendFileSubscriber; use Alchemy\Phrasea\Http\H264PseudoStreaming\H264Factory; use Alchemy\Phrasea\Http\ServeFileResponseFactory; -use Alchemy\Phrasea\Http\StaticFile\StaticFileFactory; use Alchemy\Phrasea\Http\StaticFile\StaticMode; -use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker; use Alchemy\Phrasea\Http\XSendFile\XSendFileFactory; use Silex\Application; use Silex\ServiceProviderInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; class FileServeServiceProvider implements ServiceProviderInterface { @@ -45,7 +44,7 @@ class FileServeServiceProvider implements ServiceProviderInterface }); $app['phraseanet.file-serve'] = $app->share(function (Application $app) { - return ServeFileResponseFactory::create($app); + return new ServeFileResponseFactory($app['unicode']); }); } @@ -55,7 +54,7 @@ class FileServeServiceProvider implements ServiceProviderInterface public function boot(Application $app) { $app['dispatcher'] = $app->share( - $app->extend('dispatcher', function ($dispatcher, Application $app) { + $app->extend('dispatcher', function (EventDispatcherInterface $dispatcher, Application $app) { $dispatcher->addSubscriber(new XSendFileSubscriber($app)); return $dispatcher; diff --git a/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php b/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php index 636f9e211a..51ab34c399 100644 --- a/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php +++ b/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php @@ -11,7 +11,6 @@ namespace Alchemy\Phrasea\Http; -use Alchemy\Phrasea\Application; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\BinaryFileResponse; @@ -24,17 +23,6 @@ class ServeFileResponseFactory implements DeliverDataInterface $this->unicode = $unicode; } - /** - * @param Application $app - * @return self - */ - public static function create(Application $app) - { - return new self( - $app['unicode'] - ); - } - /** * {@inheritdoc} */ diff --git a/tests/Alchemy/Tests/Phrasea/Http/ServeFileResponseFactoryTest.php b/tests/Alchemy/Tests/Phrasea/Http/ServeFileResponseFactoryTest.php index 28f501db09..668f2a180b 100644 --- a/tests/Alchemy/Tests/Phrasea/Http/ServeFileResponseFactoryTest.php +++ b/tests/Alchemy/Tests/Phrasea/Http/ServeFileResponseFactoryTest.php @@ -16,12 +16,6 @@ class ServeFileResponseFactoryTest extends \PhraseanetWebTestCase { protected $factory; - public function testDeliverFileFactoryCreation() - { - $factory = ServeFileResponseFactory::create(self::$DI['app']); - $this->assertInstanceOf('Alchemy\Phrasea\Http\ServeFileResponseFactory', $factory); - } - public function testDeliverFile() { $this->factory = new ServeFileResponseFactory(new \unicode());