Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -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) {