mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-27 07:16:10 +03:00
23 lines
572 B
PHP
23 lines
572 B
PHP
<?php
|
|
|
|
namespace Guzzle\Http\QueryAggregator;
|
|
|
|
use Guzzle\Http\QueryString;
|
|
|
|
/**
|
|
* Does not aggregate nested query string values and allows duplicates in the resulting array
|
|
*
|
|
* Example: http://test.com?q=1&q=2
|
|
*/
|
|
class DuplicateAggregator implements QueryAggregatorInterface
|
|
{
|
|
public function aggregate($key, $value, QueryString $query)
|
|
{
|
|
if ($query->isUrlEncoding()) {
|
|
return array($query->encodeValue($key) => array_map(array($query, 'encodeValue'), $value));
|
|
} else {
|
|
return array($key => $value);
|
|
}
|
|
}
|
|
}
|