xp-framework/compiler

Adjust to new PHP annotation syntax

thekid opened this issue · 6 comments

Use #[...] instead of << >>, see https://wiki.php.net/rfc/shorter_attribute_syntax

  • Support both in the first step in a patch level release
  • Add an E_DEPRECATED warning to << >> syntax in order to make unittests fail but production code work in next minor release
  • Remove support for << >> in next major release

Initial syntactic support added to xp-framework/ast xp-framework/ast#7 though still missing inline attributes and support for multiple arguments

The pull request xp-framework/ast#7 can now be merged; and the dependency updated accordingly.

2️⃣ With named arguments support in https://github.com/xp-framework/compiler/releases/tag/v5.3.0, we can now support rewriting annotations to more idiomatic PHP

3️⃣ With xp-framework/ast#9 merged, deprecation notices will be emitted (but production code continues to work!)