-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#699Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-master |
| Installed as | composer dependency |
Rule ManualJsonStringToJsonEncodeArrayRector always convert manual JSON string to \Nette\Utils\Json::encode array even if the class 'Nette\Utils\Json' not found.
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1ebfe3fd-7e9c-614c-9bb2-274ba6035927
<?php
final class DemoFile
{
public function run()
{
$someJsonAsString = '{"role_name":"admin","numberz":{"id":"10"}}';
}
}Responsible rules
ManualJsonStringToJsonEncodeArrayRector
Expected Behavior
Any of the following options:
- Convert manual JSON string to json_encode array and let
JsonDecodeEncodeToNetteUtilsJsonDecodeEncodeRectorin rector-nette handle the rest. - Convert manual JSON string to json_encode array if the class 'Nette\Utils\Json' not found.