@@ -80,6 +80,9 @@ |
||
80 | 80 | $conn->write($response); |
81 | 81 | } |
82 | 82 | |
83 | + /** |
|
84 | + * @param string $file |
|
85 | + */ |
|
83 | 86 | protected function serveFile(SocketConnection $conn, $file) |
84 | 87 | { |
85 | 88 | if(($path = realpath($file)) === null){ |
@@ -29,6 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
32 | + * @param MessageQueue $data |
|
32 | 33 | * @return Frame |
33 | 34 | */ |
34 | 35 | public static function parse($data) |
@@ -71,6 +72,9 @@ discard block |
||
71 | 72 | return $frame; |
72 | 73 | } |
73 | 74 | |
75 | + /** |
|
76 | + * @param string $data |
|
77 | + */ |
|
74 | 78 | protected function __construct($data = null, $final = true, $opcode = self::OP_TEXT) |
75 | 79 | { |
76 | 80 | $this->firstByte = ($final ? 0x80 : 0) + $opcode; |
@@ -102,6 +106,9 @@ discard block |
||
102 | 106 | $this->secondByte = $byte; |
103 | 107 | } |
104 | 108 | |
109 | + /** |
|
110 | + * @param string $data |
|
111 | + */ |
|
105 | 112 | public function setData($data) |
106 | 113 | { |
107 | 114 | $this->data = ''; |
@@ -135,6 +142,9 @@ discard block |
||
135 | 142 | return $maskingKey; |
136 | 143 | } |
137 | 144 | |
145 | + /** |
|
146 | + * @param string $maskingKey |
|
147 | + */ |
|
138 | 148 | protected function applyMask($maskingKey, $payload = null) |
139 | 149 | { |
140 | 150 | $applied = ''; |
@@ -145,6 +155,9 @@ discard block |
||
145 | 155 | return $applied; |
146 | 156 | } |
147 | 157 | |
158 | + /** |
|
159 | + * @param string $payload |
|
160 | + */ |
|
148 | 161 | protected function maskPayload($payload) |
149 | 162 | { |
150 | 163 | if (!$this->isMask()) { |
@@ -180,6 +193,9 @@ discard block |
||
180 | 193 | } |
181 | 194 | } |
182 | 195 | |
196 | + /** |
|
197 | + * @param MessageQueue $encodedData |
|
198 | + */ |
|
183 | 199 | public function decode($encodedData) |
184 | 200 | { |
185 | 201 | $this->isCoalesced = false; |
@@ -252,6 +268,11 @@ discard block |
||
252 | 268 | return pack('CC', $this->firstByte, $this->secondByte) . $this->extendedPayload . $this->maskPayload($this->data); |
253 | 269 | } |
254 | 270 | |
271 | + /** |
|
272 | + * @param string $data |
|
273 | + * @param integer $secondByte |
|
274 | + * @param string $extendedPayload |
|
275 | + */ |
|
255 | 276 | protected function updatePayloadLength($data, &$secondByte, &$extendedPayload) |
256 | 277 | { |
257 | 278 | $secondByte &= 0x80; |