1 | <?php |
||
14 | class DataFrame extends \Hyphper\Frame implements PaddingInterface |
||
15 | { |
||
16 | use PaddingTrait; |
||
17 | |||
18 | protected $defined_flags = [ |
||
19 | Flag::END_STREAM, |
||
20 | Flag::PADDED |
||
21 | ]; |
||
22 | |||
23 | protected $type = 0x0; |
||
24 | protected $stream_association = self::HAS_STREAM; |
||
25 | protected $data; |
||
26 | |||
27 | /** |
||
28 | * DataFrame constructor. |
||
29 | * |
||
30 | * @param array $options |
||
31 | */ |
||
32 | 13 | public function __construct(array $options = []) |
|
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | 5 | public function serializeBody(): string |
|
48 | |||
49 | /** |
||
50 | * Given the body of a frame, parses it into frame data. This populates |
||
51 | * the non-header parts of the frame: that is, it does not populate the |
||
52 | * stream ID or flags. |
||
53 | * |
||
54 | * |
||
55 | * @param string $data |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | 7 | public function parseBody(string $data) |
|
72 | |||
73 | /** |
||
74 | * The length of the frame that needs to be accounted for when considering |
||
75 | * flow control. |
||
76 | */ |
||
77 | 2 | public function flowControlledLength() |
|
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | 3 | public function getData() |
|
90 | |||
91 | /** |
||
92 | * @param int $data |
||
93 | * |
||
94 | * @return DataFrame |
||
95 | */ |
||
96 | 5 | public function setData($data) |
|
102 | } |
||
103 |