mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-14 03:42:41 +09:00
Update to laravel 7
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Github\HttpClient\Plugin;
|
||||
|
||||
use Http\Client\Common\Plugin;
|
||||
use Http\Promise\Promise;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
@@ -10,22 +11,29 @@ use Psr\Http\Message\RequestInterface;
|
||||
*
|
||||
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
||||
*/
|
||||
class PathPrepend implements Plugin
|
||||
final class PathPrepend implements Plugin
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $path;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
*/
|
||||
public function __construct($path)
|
||||
public function __construct(string $path)
|
||||
{
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @param RequestInterface $request
|
||||
* @param callable $next
|
||||
* @param callable $first
|
||||
*
|
||||
* @return Promise
|
||||
*/
|
||||
public function handleRequest(RequestInterface $request, callable $next, callable $first)
|
||||
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
|
||||
{
|
||||
$currentPath = $request->getUri()->getPath();
|
||||
if (strpos($currentPath, $this->path) !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user