1 | <?php |
||
24 | final class Frame |
||
25 | { |
||
26 | private $type; |
||
27 | private $channel; |
||
28 | private $method; |
||
29 | private $values; |
||
30 | private $string; |
||
31 | |||
32 | 93 | private function __construct( |
|
54 | |||
55 | 86 | public static function method( |
|
56 | Channel $channel, |
||
57 | Method $method, |
||
58 | Value ...$values |
||
59 | ): self { |
||
60 | 86 | $self = new self( |
|
61 | 86 | Type::method(), |
|
62 | 86 | $channel, |
|
63 | 86 | new UnsignedShortInteger(new Integer($method->class())), |
|
64 | 86 | new UnsignedShortInteger(new Integer($method->method())), |
|
65 | 86 | ...$values |
|
66 | ); |
||
67 | 86 | $self->method = $method; |
|
68 | 86 | $self->values = (new Sequence(...$values))->reduce( |
|
69 | 86 | $self->values, |
|
70 | 86 | static function(Stream $stream, Value $value): Stream { |
|
71 | 80 | return $stream->add($value); |
|
72 | 86 | } |
|
73 | ); |
||
74 | |||
75 | 86 | return $self; |
|
76 | } |
||
77 | |||
78 | 27 | public static function header( |
|
99 | |||
100 | 24 | public static function body(Channel $channel, Str $payload): self |
|
111 | |||
112 | 12 | public static function heartbeat(): self |
|
119 | |||
120 | 84 | public function type(): Type |
|
124 | |||
125 | 83 | public function channel(): Channel |
|
129 | |||
130 | 77 | public function is(Method $method): bool |
|
138 | |||
139 | /** |
||
140 | * @return StreamInterface<Value> |
||
|
|||
141 | */ |
||
142 | 86 | public function values(): StreamInterface |
|
146 | |||
147 | 57 | public function __toString(): string |
|
151 | |||
152 | 93 | public static function end(): int |
|
156 | } |
||
157 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.