Skip to content
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

[Formatting Bug]: PHP new with variable name from associative array #846

Open
Martin-Eckleben opened this issue May 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Martin-Eckleben
Copy link

Martin-Eckleben commented May 22, 2024

I know this is a hard edge case :)
Just posting it for completeness ;)

Platform

Linux

Template before formatting

$connected_entity = new $field['model'];

Template after formatting

$connected_entity = new ($field['model'])();

Expected Behaviour

It should format functionally.
I get a syntax error after reformatting (PHP 7.2)

Before:
image

After:
image

Workaround:
image

Relevant log output

No response

@Martin-Eckleben Martin-Eckleben added the bug Something isn't working label May 22, 2024
@Martin-Eckleben Martin-Eckleben changed the title [Formatting Bug]: PHP new with variable name [Formatting Bug]: PHP new with variable name from associative array May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants