Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
subrequests
Commits
e11e3858
Unverified
Commit
e11e3858
authored
Mar 24, 2017
by
Mateu Aguiló Bosch
Browse files
Rename path to uri
parent
a5df8002
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Normalizer/JsonBlueprintDenormalizer.php
View file @
e11e3858
...
...
@@ -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
);
...
...
src/Normalizer/JsonSubrequestDenormalizer.php
View file @
e11e3858
...
...
@@ -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
(
'
quer
y'
=>
array
()
,
'
bod
y'
=>
array
()
,
'headers'
=>
array
()
,
)
,
parse_url
(
$data
[
'path'
]));
$data
=
NestedArray
::
mergeDeep
(
$data
,
[
'
bod
y'
=>
[]
,
'
quer
y'
=>
[]
,
'headers'
=>
[]
,
]
,
parse_url
(
$data
[
'path'
]));
/** @var \Symfony\Component\HttpFoundation\Request $master_request */
$master_request
=
$context
[
'master_request'
];
...
...
src/Normalizer/MultiresponseNormalizer.php
View file @
e11e3858
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment