1 | <?php |
||
14 | class PushPromiseFrame extends \Hyphper\Frame implements PaddingInterface |
||
15 | { |
||
16 | use PaddingTrait; |
||
17 | |||
18 | protected $defined_flags = [ |
||
19 | Flag::END_HEADERS, |
||
20 | Flag::PADDED |
||
21 | ]; |
||
22 | |||
23 | protected $type = 0x05; |
||
24 | protected $stream_association = self::HAS_STREAM; |
||
25 | /** |
||
26 | * @var int The stream ID that is promised by this frame. |
||
27 | */ |
||
28 | protected $promised_stream_id; |
||
29 | |||
30 | protected $data; |
||
31 | |||
32 | 6 | public function __construct(array $options = []) |
|
39 | |||
40 | 2 | public function serializeBody(): string |
|
51 | |||
52 | /** |
||
53 | * Given the body of a frame, parses it into frame data. This populates |
||
54 | * the non-header parts of the frame: that is, it does not populate the |
||
55 | * stream ID or flags. |
||
56 | * |
||
57 | * |
||
58 | * @param string $data |
||
59 | * @throws InvalidFrameException |
||
60 | * @throws InvalidPaddingException |
||
61 | * @return void |
||
62 | */ |
||
63 | 4 | public function parseBody(string $data) |
|
80 | |||
81 | /** |
||
82 | * @return int |
||
83 | */ |
||
84 | 1 | public function getPromisedStreamId() |
|
88 | |||
89 | /** |
||
90 | * @param int $promised_stream_id |
||
91 | * @return $this |
||
92 | */ |
||
93 | 1 | public function setPromisedStreamId(int $promised_stream_id) |
|
98 | |||
99 | /** |
||
100 | * @return int|mixed |
||
101 | */ |
||
102 | 2 | public function getData() |
|
106 | |||
107 | /** |
||
108 | * @param string $data |
||
109 | * @return $this |
||
110 | */ |
||
111 | 2 | public function setData(string $data) |
|
116 | } |
||
117 |