-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I'm creating a rector rule and do the following:
- create a native php array
- parse it with the php parser
- append the new array item to another php array which is there as parsed array
Expected:
<?php\n
\n
return [\n
'tools_toolsmaintenance' => [\n
'parent' => 'tools',\n
'access' => 'systemMaintainer',\n
'path' => '/module/tools/toolsmaintenance',\n
'iconIdentifier' => 'module-install-maintenance',\n
'labels' => 'LLL:EXT:install/Resources/Private/Language/ModuleInstallMaintenance.xlf',\n
'routes' => [\n
'_default' => [\n
'target' => 'TYPO3\\CMS\\Install\\Controller\\BackendModuleController::maintenanceAction',\n
],\n
],\n
],\n
'tools_toolssettings' => [\n
'parent' => 'tools',\n
'access' => 'systemMaintainer',\n
'path' => '/module/tools/settings',\n
'iconIdentifier' => 'module-install-settings',\n
'labels' => 'LLL:EXT:install/Resources/Private/Language/ModuleInstallSettings.xlf',\n
'routes' => [\n
'_default' => [\n
'target' => 'TYPO3\\CMS\\Install\\Controller\\BackendModuleController::settingsAction',\n
],\n
],\n
],\n
];\n
Actual:
<?php\n
\n
return [\n
'tools_toolsmaintenance' => [\n
'parent' => 'tools',\n
'access' => 'systemMaintainer',\n
'path' => '/module/tools/toolsmaintenance',\n
'iconIdentifier' => 'module-install-maintenance',\n
'labels' => 'LLL:EXT:install/Resources/Private/Language/ModuleInstallMaintenance.xlf',\n
'routes' => [\n
'_default' => [\n
'target' => 'TYPO3\\CMS\\Install\\Controller\\BackendModuleController::maintenanceAction',\n
],\n
],\n
], 'tools_toolsmaintenance' => [\n
'parent' => 'tools',\n
'access' => 'systemMaintainer',\n
'path' => '/module/tools/toolsmaintenance',\n
'iconIdentifier' => 'module-install-maintenance',\n
'labels' => 'LLL:EXT:install/Resources/Private/Language/ModuleInstallMaintenance.xlf',\n
'routes' => [\n
'_default' => [\n
'target' => 'TYPO3\\CMS\\Install\\Controller\\BackendModuleController::maintenanceAction',\n
],\n
],\n
],\n
];\n
The strange thing is that the merged array looks good in xdebug:
but the output is a duplicate of the original array item and I don't understand why this is happening.
My PR of the rule is here sabbelasichon/typo3-rector#4243 and the important section is here: https://github.com/sabbelasichon/typo3-rector/pull/4243/files#diff-6659bbad2dc4a8d574769de61529b6e6d9387889d39813bbe2f246c873ba3bfeR231
Can you please help me as I'm totally stuck? I don't understand what is happening in the PrettyPrinterAbstract class as it is quite complex
Metadata
Metadata
Assignees
Labels
No labels