0 votes

The following fatal exception is thrown when exporting a model which has at least one property declared with a PHP 8 union type:

 Invalid variable character[|], different than $

Project Info:
- Doctrine 2
- No ORM
- Export Data Format: Doctrine2 Annotations

Minimum reproduction example:

<?php

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class SampleEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $test;

    private string|null $example = null;

    public function getTest(): ?string
    {
        return $this->test;
    }

    public function getExample(): ?string
    {
        return $this->example;
    }
}
in Solved by (150 points)
recategorized by

Hello Mathewa,

thank you for the report. Can you please send me ([email protected]) the Skipper project which exports this PHP file?

Together with the expected output.

Thanks
Ludek

Hello,

I have sent you a minimal reproduction example project with steps to reproduce the issue.

Regards

Hello, unfortunately, your email doesn't contain any attachment. Can you please send it again?

1 Answer

0 votes
Best answer

Hello,

we just released a new beta which contains PHP parser fix for this issue.

https://www.skipper18.com/support/402/downloads-skipper-beta

Please try it and let me know if everything works as expected.

Thanks

by Skipper developer (138k points)
selected by

I have verified that this is functional. Thank you!