currently, encodeApplicationJson use json_encode() without flags, is there any way to add default flags like:
if ($parameters instanceof \JsonSerializable) {
return json_encode($parameters, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
if (is_array($parameters) || $parameters instanceof \ArrayAccess) {
$parameters = $this->scalarizeArray($parameters);
return json_encode($parameters, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
|
protected function encodeApplicationJson($method, $parameters) |
|
{ |
|
if ($method !== 'GET' && array_key_exists('Content-Type', $this->connectionModule->headers) |
|
&& ($this->connectionModule->headers['Content-Type'] === 'application/json' |
|
|| preg_match('!^application/.+\+json$!', $this->connectionModule->headers['Content-Type']) |
|
) |
|
) { |
|
if ($parameters instanceof \JsonSerializable) { |
|
return json_encode($parameters); |
|
} |
|
if (is_array($parameters) || $parameters instanceof \ArrayAccess) { |
|
$parameters = $this->scalarizeArray($parameters); |
|
return json_encode($parameters); |
|
} |
|
} |
|
return $parameters; |
|
} |
currently,
encodeApplicationJsonusejson_encode()without flags, is there any way to add default flags like:module-rest/src/Codeception/Module/REST.php
Lines 676 to 692 in e314fe7