Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented May 5, 2025

use Nette\Utils\Json;

final class SomeStaticCalls
{
    public function run($data, $json)
    {
-        $encodedJson = Json::encode($data, true);
+	     $encodedJson = Json::encode($data, pretty: true);


-        $decodedJson = Json::decode($json, true);
+        $decodedJson = Json::decode($json, forceArrays: true);
    }
}

@TomasVotruba TomasVotruba changed the title tv nette utils [nette/utils] [4.0] Add upgrade set to handle named args in Json class May 5, 2025
@TomasVotruba TomasVotruba merged commit ef1c19f into main May 5, 2025
45 checks passed
@TomasVotruba TomasVotruba deleted the tv-nette-utils branch May 5, 2025 16:47
@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants