backdrop-contrib / coder_upgrade

Helps automate some/most of the work required to upgrade a module from Drupal to Backdrop 1.x
GNU General Public License v2.0
4 stars 7 forks source link

Doesn't handle anonymous functions very well. #86

Open argiepiano opened 1 year ago

argiepiano commented 1 year ago

Anonymous functions are not converted correctly.

This:

  $exceptions = array_reduce($types, function (&$result, $item) {
    $result[] = $item['path'];
    return $result;
  }, $default_exceptions);

Results into this:

  $exceptions = array_reduce($types, ($result $item){
    $result[] = $item['path']
    $result
  }, $default_exceptions);

Which has several syntax errors.

laryn commented 1 year ago

Also noting that the stripping out of the & from function variables seems to be a more widespread problem of late.