Commit e11e3858 authored by Mateu Aguiló Bosch's avatar Mateu Aguiló Bosch

Rename path to uri

parent a5df8002
......@@ -30,7 +30,7 @@ class JsonBlueprintDenormalizer implements DenormalizerInterface, SerializerAwar
/**
* {@inheritdoc}
*/
public function denormalize($data, $class, $format = NULL, array $context = array()) {
public function denormalize($data, $class, $format = NULL, array $context = []) {
// The top level is an array of normalized requests.
$requests = array_map(function ($item) use ($format, $context) {
return $this->serializer->denormalize($item, Request::class, $format, $context);
......
......@@ -21,21 +21,22 @@ class JsonSubrequestDenormalizer implements DenormalizerInterface {
*
* @return object
*/
public function denormalize($data, $class, $format = NULL, array $context = array()) {
public function denormalize($data, $class, $format = NULL, array $context = []) {
if (!Parser::isValidSubrequest($data)) {
throw new \RuntimeException('The provided blueprint contains an invalid subrequest.');
}
$data['path'] = parse_url($data['path'], PHP_URL_PATH);
$data['path'] = parse_url($data['uri'], PHP_URL_PATH);
$data['query'] = parse_url($data['uri'], PHP_URL_QUERY);
if (isset($data['query']) && !is_array($data['query'])) {
$query = array();
$query = [];
parse_str($data['query'], $query);
$data['query'] = $query;
}
$data = NestedArray::mergeDeep($data, array(
'query' => array(),
'body' => array(),
'headers' => array(),
), parse_url($data['path']));
$data = NestedArray::mergeDeep($data, [
'body' => [],
'query' => [],
'headers' => [],
], parse_url($data['path']));
/** @var \Symfony\Component\HttpFoundation\Request $master_request */
$master_request = $context['master_request'];
......
......@@ -11,7 +11,7 @@ class MultiresponseNormalizer implements NormalizerInterface {
/**
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = array()) {
public function normalize($object, $format = NULL, array $context = []) {
$delimiter = $context['delimiter'];
$separator = sprintf("\r\n--%s\r\n", $delimiter);
// Join the content responses with the separator.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment