Skip to content

Commit

Permalink
bug fixed for create request
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Feb 9, 2018
1 parent 6cf2124 commit bf0b5a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/HttpFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ public static function createServerRequest($method, $uri)
/**
* Create a new server request from server variables.
* @param array|mixed $server Typically $_SERVER or similar structure.
* @param string|null $class The class
* @param string|null $class The custom request class
* @return ServerRequestInterface
* @throws \RuntimeException
* @throws \InvalidArgumentException
* If no valid method or URI can be determined.
*/
public static function createServerRequestFromArray($server, $class = null)
public static function createServerRequestFromArray($server, string $class = null)
{
$env = self::ensureIsCollection($server);
$uri = static::createUriFromArray($env);
$method = $env['REQUEST_METHOD'];
$method = $env->get('REQUEST_METHOD', 'GET');
$headers = static::createHeadersFromArray($env);
$cookies = Cookies::parseFromRawHeader($headers->get('Cookie', []));
$serverParams = $env->all();
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/RequestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function getRequestTarget(): string
* @param string $requestTarget
* @return $this
*/
public function withRequestTarget(string $requestTarget)
public function withRequestTarget($requestTarget)
{
if (preg_match('#\s#', $requestTarget)) {
throw new \InvalidArgumentException(
Expand Down

0 comments on commit bf0b5a6

Please sign in to comment.