1: <?php
2:
3: namespace Guzzle\Http\QueryAggregator;
4:
5: use Guzzle\Http\QueryString;
6:
7: /**
8: * Aggregates nested query string variables using commas
9: */
10: class CommaAggregator implements QueryAggregatorInterface
11: {
12: /**
13: * {@inheritdoc}
14: */
15: public function aggregate($key, $value, QueryString $query)
16: {
17: if ($query->isUrlEncoding()) {
18: return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value)));
19: } else {
20: return array($key => implode(',', $value));
21: }
22: }
23: }
24: