添加网站文件
This commit is contained in:
13
vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php
vendored
Normal file
13
vendor/guzzlehttp/guzzle-services/src/QuerySerializer/QuerySerializerInterface.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace GuzzleHttp\Command\Guzzle\QuerySerializer;
|
||||
|
||||
interface QuerySerializerInterface
|
||||
{
|
||||
/**
|
||||
* Aggregate query params and transform them into a string
|
||||
*
|
||||
* @param array $queryParams
|
||||
* @return string
|
||||
*/
|
||||
public function aggregate(array $queryParams);
|
||||
}
|
||||
33
vendor/guzzlehttp/guzzle-services/src/QuerySerializer/Rfc3986Serializer.php
vendored
Normal file
33
vendor/guzzlehttp/guzzle-services/src/QuerySerializer/Rfc3986Serializer.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace GuzzleHttp\Command\Guzzle\QuerySerializer;
|
||||
|
||||
class Rfc3986Serializer implements QuerySerializerInterface
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $removeNumericIndices;
|
||||
|
||||
/**
|
||||
* @param bool $removeNumericIndices
|
||||
*/
|
||||
public function __construct($removeNumericIndices = false)
|
||||
{
|
||||
$this->removeNumericIndices = $removeNumericIndices;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function aggregate(array $queryParams)
|
||||
{
|
||||
$queryString = http_build_query($queryParams, null, '&', PHP_QUERY_RFC3986);
|
||||
|
||||
if ($this->removeNumericIndices) {
|
||||
$queryString = preg_replace('/%5B[0-9]+%5D/simU', '%5B%5D', $queryString);
|
||||
}
|
||||
|
||||
return $queryString;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user