1: <?php
2:
3: namespace Guzzle\Http\QueryAggregator;
4:
5: use Guzzle\Http\QueryString;
6:
7: 8: 9:
10: class PhpAggregator implements QueryAggregatorInterface
11: {
12: 13: 14:
15: public function aggregate($key, $value, QueryString $query)
16: {
17: $ret = array();
18:
19: foreach ($value as $k => $v) {
20: $k = "{$key}[{$k}]";
21: if (is_array($v)) {
22: $ret = array_merge($ret, self::aggregate($k, $v, $query));
23: } else {
24: $ret[$query->encodeValue($k)] = $query->encodeValue($v);
25: }
26: }
27:
28: return $ret;
29: }
30: }
31: