Skip to content

Commit

Permalink
Improve typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Feb 6, 2019
1 parent 2f6735e commit 7da44ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Psr7Request.php
Expand Up @@ -8,8 +8,8 @@
use Psr\Http\Message\RequestInterface;

/**
* @method self|static withAttribute($name, $value)
* @method self|static withHeader($header, $value)
* @method static withAttribute($name, $value)
* @method static withHeader($header, $value)
*/
class Psr7Request extends Request
{
Expand All @@ -21,6 +21,9 @@ class Psr7Request extends Request
* FACTORY *****************************************************************
*/

/**
* @return static
*/
public static function of(RequestInterface $request): self
{
$new = new static(
Expand Down
8 changes: 7 additions & 1 deletion src/Psr7ServerRequest.php
Expand Up @@ -12,7 +12,7 @@

/**
* @method Psr7UploadedFile[] getUploadedFiles()
* @method self|static withHeader($header, $value)
* @method static withHeader($header, $value)
*/
class Psr7ServerRequest extends ServerRequest
{
Expand Down Expand Up @@ -53,6 +53,9 @@ public static function normalizeNetteFiles(array $files): array
* ATTRIBUTES **************************************************************
*/

/**
* @return static
*/
public static function of(ServerRequestInterface $request): self
{
$new = new static(
Expand All @@ -75,6 +78,9 @@ public static function of(ServerRequestInterface $request): self
* FACTORY *****************************************************************
*/

/**
* @return static
*/
public static function fromGlobals(): self
{
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
Expand Down

0 comments on commit 7da44ab

Please sign in to comment.