mirror of
https://gh.wpcy.net/https://github.com/pixelabs-wp/whitelabel-plugins-update-server.git
synced 2026-04-19 05:26:01 +08:00
40 lines
866 B
PHP
40 lines
866 B
PHP
<?php
|
|
namespace Aws\Api\Serializer;
|
|
|
|
use Aws\Api\Shape;
|
|
use Aws\Api\ListShape;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class Ec2ParamBuilder extends QueryParamBuilder
|
|
{
|
|
protected function queryName(Shape $shape, $default = null)
|
|
{
|
|
return ($shape['queryName']
|
|
?: ucfirst(@$shape['locationName'] ?: ""))
|
|
?: $default;
|
|
}
|
|
|
|
protected function isFlat(Shape $shape)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
protected function format_list(
|
|
ListShape $shape,
|
|
array $value,
|
|
$prefix,
|
|
&$query
|
|
) {
|
|
// Handle empty list serialization
|
|
if (!$value) {
|
|
$query[$prefix] = false;
|
|
} else {
|
|
$items = $shape->getMember();
|
|
foreach ($value as $k => $v) {
|
|
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
|
}
|
|
}
|
|
}
|
|
}
|