nanch / phpfmt_stable

This is a stable snapshot (version 6125cf9) of the phpfmt plugin for Sublime Text
143 stars 34 forks source link

Incorrect transformation behavior `new Class()` #10

Open mrpavlikov opened 8 years ago

mrpavlikov commented 8 years ago

There is some transformation that adds () to new instances:

new Class => new Class()

But it does things wrong in a bit more complex case:

$statsClass = new $config['statsField'][0];

results in syntax error (as for php 5)

$statsClass = new $config['statsField'()][0];

expected result:

$statsClass = new $config['statsField'][0]();