111
This commit is contained in:
@@ -14,7 +14,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
use Http\Message\ServerRequest as RequestMessage;
|
||||
use Http\Message\Response as Psr7Response;
|
||||
use Server\ServerManager;
|
||||
use Server\SInterface\DownloadInterface;
|
||||
use Server\SInterface\OnDownloadInterface;
|
||||
|
||||
|
||||
/**
|
||||
@@ -201,9 +201,9 @@ class Response implements ResponseInterface
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return DownloadInterface
|
||||
* @return OnDownloadInterface
|
||||
*/
|
||||
public function file(string $path): DownloadInterface
|
||||
public function file(string $path): OnDownloadInterface
|
||||
{
|
||||
return $this->__call__()->{__FUNCTION__}($path);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Server\Constrict;
|
||||
|
||||
use Annotation\Inject;
|
||||
use Server\SInterface\DownloadInterface;
|
||||
use Server\SInterface\OnDownloadInterface;
|
||||
use Swoole\Server;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class ResponseEmitter implements Emitter
|
||||
$response->header('Server', 'swoole');
|
||||
$response->header('Swoole-Version', swoole_version());
|
||||
|
||||
if (!($emitter instanceof DownloadInterface)) {
|
||||
if (!($emitter instanceof OnDownloadInterface)) {
|
||||
$response->end($emitter->getBody()->getContents());
|
||||
} else {
|
||||
$emitter->dispatch($response);
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Server\Constrict;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Http\Message\Response;
|
||||
use Server\SInterface\DownloadInterface;
|
||||
use Server\SInterface\OnDownloadInterface;
|
||||
|
||||
/**
|
||||
* @mixin Response
|
||||
@@ -16,9 +16,9 @@ interface ResponseInterface extends \Psr\Http\Message\ResponseInterface
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return DownloadInterface
|
||||
* @return OnDownloadInterface
|
||||
*/
|
||||
public function file(string $path): DownloadInterface;
|
||||
public function file(string $path): OnDownloadInterface;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user