@@ 122-130 (lines=9) @@ | ||
119 | * @param array $definition [$valueType] |
|
120 | * @return array |
|
121 | */ |
|
122 | public function readList(array $definition) { |
|
123 | list($valueType) = $definition; |
|
124 | $list = []; |
|
125 | $count = $this->readInt(); |
|
126 | for ($i = 0; $i < $count; ++$i) { |
|
127 | $list[] = $this->readValue($valueType); |
|
128 | } |
|
129 | return $list; |
|
130 | } |
|
131 | ||
132 | /** |
|
133 | * Read map. |
|
@@ 138-146 (lines=9) @@ | ||
135 | * @param array $definition [$keyType, $valueType] |
|
136 | * @return array |
|
137 | */ |
|
138 | public function readMap(array $definition) { |
|
139 | list($keyType, $valueType) = $definition; |
|
140 | $map = []; |
|
141 | $count = $this->readInt(); |
|
142 | for ($i = 0; $i < $count; ++$i) { |
|
143 | $map[$this->readValue($keyType)] = $this->readValue($valueType); |
|
144 | } |
|
145 | return $map; |
|
146 | } |
|
147 | ||
148 | /** |
|
149 | * |