Skip to content

[nette/utils] [4.0] Add upgrade set to handle named args in Json class #6884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 5, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant