-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpMessagingInterface.php
More file actions
executable file
·46 lines (40 loc) · 1.34 KB
/
Copy pathHttpMessagingInterface.php
File metadata and controls
executable file
·46 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Interface HttpMessagingInterface
*
* Defines the contract for interacting with PSR-7 HTTP message components within Blunder.
* Ensures consistent access to request, response, and stream objects,
* whether injected externally or created internally by the error handler.
*
* Implementations like `HttpMessaging` allow handlers to remain PSR-7 compatible
* while abstracting away underlying HTTP message details.
*
* @package MaplePHP\Blunder\Interfaces
* @author Daniel Ronkainen
* @license Apache-2.0 license, Copyright © Daniel Ronkainen
* Don't delete this comment, it's part of the license.
*/
namespace MaplePHP\Blunder\Interfaces;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
interface HttpMessagingInterface
{
/**
* Get PSR response
* @return ResponseInterface
*/
public function response(): ResponseInterface;
/**
* Get PSR request
* @return ServerRequestInterface
*/
public function request(): ServerRequestInterface;
/**
* Inherit or create new stream instance from PSR-7
* @param mixed|null $stream
* @param string $permission
* @return StreamInterface
*/
public function stream(mixed $stream = null, string $permission = "r+"): StreamInterface;
}