Closed frankii91 closed 1 week ago
Could you reproduce at https://getrector.com/demo ? Thank you
I am closing it as no code and config provided. If I check your example, it seems you're changing smarty, that third party vendor, my suggestion is to not change vendor or third party code.
You can skip the path of it https://getrector.com/documentation/ignoring-rules-or-paths
t4o że smarty to nie znaczy że w pełni zewnętrzne odłamane w około 2015 i optymalizowane na własną rękę ...
pt., 30 sie 2024 o 20:42 Abdul Malik Ikhsan @.***> napisał(a):
I am closing it as no code and config provided. If I check your example, it seems you're changing smarty, that third party vendor, my suggestion is to not change vendor or third party code.
You can skip the path of it https://getrector.com/documentation/ignoring-rules-or-paths
— Reply to this email directly, view it on GitHub https://github.com/rectorphp/rector/issues/8796#issuecomment-2322136304, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLSI3WZQXNYUWM7HBJYK2DZUC4K7AVCNFSM6AAAAABMYQCQUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRSGEZTMMZQGQ . You are receiving this because you authored the thread.Message ID: @.***>
Bug Report
error with more complex code...
Minimal PHP Code Causing Issue
code before using rector:
code with syntax errors after changing: if (isset($parameter['smarty_internal_index'])) { $output = "<?php \$_smarty_tpl->createLocalArrayVariable($_attr[var], {$_nocache}, {$_scope});\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];"; } elseif ($compiler->template->smarty instanceof SmartyBC) { // implement Smarty2's behaviour of variables assigned by reference $output = sprintf('<?php if (isset($_smarty_tpl->tpl_vars[%s])) {$_smarty_tpl->tpl_vars[%s] = clone $_smarty_tpl->tpl_vars[%s];', $_attr[var], $_attr[var], $_attr[var]); $output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = {$_nocache}; \$_smarty_tpl->tpl_vars[$_attr[var]]->scope = {$_scope};"; $output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new SmartyVariable($_attr[value], {$_nocache}, {$_scope});"; } else { $output = sprintf('<?php $_smarty_tpl->tpl_vars[%s] = new SmartyVariable(%s, %s, %s);', $_attr[var], $_attr[value], $_nocache, $_scope); }