Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit961c9ae

Browse files
Enable JSON_PRESERVE_ZERO_FRACTION in jsonRequest method
Updated the jsonRequest method to use JSON_PRESERVE_ZERO_FRACTION when encoding parameters. This ensures that floating-point values retain their precision, avoiding unintended rounding of numbers like 0.0.
1 parent983e8fa commit961c9ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/BrowserKit/AbstractBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function xmlHttpRequest(string $method, string $uri, array $parameters =
163163
*/
164164
publicfunctionjsonRequest(string$method,string$uri,array$parameters = [],array$server = [],bool$changeHistory =true):Crawler
165165
{
166-
$content =json_encode($parameters);
166+
$content =json_encode($parameters,JSON_PRESERVE_ZERO_FRACTION);
167167

168168
$this->setServerParameter('CONTENT_TYPE','application/json');
169169
$this->setServerParameter('HTTP_ACCEPT','application/json');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp