mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Initial import
This commit is contained in:
commit
2295a33590
884 changed files with 93939 additions and 0 deletions
24
php/vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php
vendored
Normal file
24
php/vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\ServerRequest;
|
||||
use Psr\Http\Message\ServerRequestFactoryInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class ServerRequestFactory implements ServerRequestFactoryInterface
|
||||
{
|
||||
public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
|
||||
{
|
||||
|
||||
if (empty($method)) {
|
||||
if (!empty($serverParams['REQUEST_METHOD'])) {
|
||||
$method = $serverParams['REQUEST_METHOD'];
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Cannot determine HTTP method');
|
||||
}
|
||||
}
|
||||
|
||||
return new ServerRequest($method, $uri, [], null, '1.1', $serverParams);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue