Home Documentation Download Pricing Buy Now
0 votes

Using ORM attribute-overrides on an entity and exporting using attributes as Doctrine data format produces invalid PHP.

#[ORM\Table(name: "data")]
#[ORM\AttributeOverrides([new ORM\AttributeOverride(name: "test", column: ORM\Column(name: "testing"))])]
class Data
{
  // ...

Causes error: PHP Fatal error: Constant expression contains invalid operations

Seems it's missing new keyword before ORM\Column.
Expected output would be:

#[ORM\Table(name: "data")]
#[ORM\AttributeOverrides([new ORM\AttributeOverride(name: "test", column: new ORM\Column(name: "testing"))])]
class Data
{
  // ...
ago in Bug report by (420 points)

thanks. i will let you know with new beta.

1 Answer

0 votes
 
Best answer

This is fixed in beta build 3.5.1.1888, which is available now.

The nested ORM\Column inside ORM\AttributeOverrides was exported without the new keyword, so PHP rejected the file. The export now produces:

#[ORM\AttributeOverrides([new ORM\AttributeOverride(name: "test", column: new ORM\Column(name: "testing"))])]

While fixing this we found a second problem in the same area: importing attribute overrides from PHP 8 attributes lost their content, so they came back as an empty list on the next export. That is corrected as well.

You can get the build here: https://www.skipper18.com/support/402/downloads-skipper-beta

Thank you for the report.

ago by Skipper developer (141k points)
selected ago by

Thanks again. This is now fixed.

You're welcome! Feel free to let us know if you find anything else or if you have any ideas on how we could improve Skipper!

...