| @@ 52-63 (lines=12) @@ | ||
| 49 | * @return array |
|
| 50 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
| 51 | */ |
|
| 52 | private function parseTable() |
|
| 53 | { |
|
| 54 | $length = $this->parseUnsignedInt32(); |
|
| 55 | $stopAt = strlen($this->buffer) - $length; |
|
| 56 | $table = []; |
|
| 57 | ||
| 58 | while (strlen($this->buffer) > $stopAt) { |
|
| 59 | $table[$this->parseShortString()] = $this->parseField(); |
|
| 60 | } |
|
| 61 | ||
| 62 | return $table; |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * Parse a table or array field. |
|
| @@ 155-166 (lines=12) @@ | ||
| 152 | * @return array |
|
| 153 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
| 154 | */ |
|
| 155 | private function parseArray() |
|
| 156 | { |
|
| 157 | $length = $this->parseUnsignedInt32(); |
|
| 158 | $stopAt = strlen($this->buffer) - $length; |
|
| 159 | $array = []; |
|
| 160 | ||
| 161 | while (strlen($this->buffer) > $stopAt) { |
|
| 162 | $array[] = $this->parseField(); |
|
| 163 | } |
|
| 164 | ||
| 165 | return $array; |
|
| 166 | } |
|
| 167 | ||
| 168 | /** |
|
| 169 | * Parse an AMQP byte-array value. |
|