If you run coder_format.php on code like the following, it will create syntax errors in the output:

class Foo {
  function bar() {
    throw new Baz();
  }
}

The output for the above is like this:

class Foo {
function bar() {
  thrownew Baz();
  }
}

This is because the T_THROW token is not supported. I'll submit a patch in a moment.

CommentFileSizeAuthor
#1 coder-support-throw-1520122-1.patch608 bytesTwoMice

Comments

TwoMice’s picture

Status: Active » Needs review
StatusFileSize
new608 bytes

With the attached patch, the above source file is output as follows:

class f {
function b() {
  throw new B();
  }
}
TwoMice’s picture

Title: add support for T_THROW » add support for T_THROW in coder_format.php
matt2000’s picture

Status: Needs review » Reviewed & tested by the community

Had the same issue, patch fixes it.

douggreen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.