Skip to content

[CodingStyle] Add ManualJsonStringToJsonEncodeArrayRector#1762

Merged
TomasVotruba merged 1 commit intomasterfrom
json-mix-to-json-call
Jul 24, 2019
Merged

[CodingStyle] Add ManualJsonStringToJsonEncodeArrayRector#1762
TomasVotruba merged 1 commit intomasterfrom
json-mix-to-json-call

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jul 24, 2019

-$someJsonAsString = '{"role_name":"admin","numberz":{"id":"10"}}';

+$data = [
+    'role_name' => 'admin',
+    'numberz' => ['id' => '10']
+];
+$someJsonAsString = json_encode($data);

This rule would not be possible without @spaceflow-app sponsor, thank you ❤️

@TomasVotruba TomasVotruba force-pushed the json-mix-to-json-call branch from 0f1b2be to 4596d65 Compare July 24, 2019 14:28
@TomasVotruba TomasVotruba merged commit 5b6da4e into master Jul 24, 2019
@TomasVotruba TomasVotruba deleted the json-mix-to-json-call branch July 24, 2019 15:32
@TomasVotruba TomasVotruba restored the json-mix-to-json-call branch August 1, 2019 10:30
@TomasVotruba TomasVotruba deleted the json-mix-to-json-call branch August 1, 2019 10:30
TomasVotruba added a commit that referenced this pull request Feb 3, 2022
rectorphp/rector-src@335206f [DX] Remove @deprecated docblock for only bool passing config in rector rules (#1762)
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