-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch refs/heads/master into feature/scopes
- Loading branch information
Showing
8 changed files
with
167 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\Http; | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
use Spiral\Core\Attribute\Scope; | ||
use Spiral\Http\Exception\HttpException; | ||
|
||
/** | ||
* Provides access to the current request in the `http` scope. | ||
* @internal | ||
*/ | ||
#[Scope('http')] | ||
final class CurrentRequest | ||
{ | ||
private ?ServerRequestInterface $request = null; | ||
|
||
public function set(ServerRequestInterface $request): void | ||
{ | ||
$this->request = $request; | ||
} | ||
|
||
public function get(): ?ServerRequestInterface | ||
{ | ||
return $this->request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.