mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
20 lines
520 B
PHP
20 lines
520 B
PHP
<?php
|
|
|
|
namespace Guzzle\Http\QueryAggregator;
|
|
|
|
use Guzzle\Http\QueryString;
|
|
|
|
/**
|
|
* Aggregates nested query string variables using commas
|
|
*/
|
|
class CommaAggregator implements QueryAggregatorInterface
|
|
{
|
|
public function aggregate($key, $value, QueryString $query)
|
|
{
|
|
if ($query->isUrlEncoding()) {
|
|
return array($query->encodeValue($key) => implode(',', array_map(array($query, 'encodeValue'), $value)));
|
|
} else {
|
|
return array($key => implode(',', $value));
|
|
}
|
|
}
|
|
}
|