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

Appearance settings

Commit b8fcd13

Browse filesBrowse 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 parent 983e8fa commit b8fcd13
Copy full SHA for b8fcd13

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/AbstractBrowser.php
+1-1Lines 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
public function jsonRequest(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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.