Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 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
    public function aggregate($key, $value, QueryString $query)
13
    {
14
        if ($query->isUrlEncoding()) {
15
            return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value)));
16
        } else {
17
            return array($key => implode(',', $value));
18
        }
19
    }
20
}