StofDoctrineExtensionsBundle
StofDoctrineExtensionsBundle copied to clipboard
PHP8 attributes and Gedmo
I quite like php8 attributes -- the error messages are now MUCH clearer, instead of getting an DocParse error with no reference to what line caused the failure, the offending line shows up in the IDE (and course, when parsed).
However, the Gedmo traits assume annotation-style declarations:
trait NestedSetEntity
{
/**
* @var int
* @Gedmo\TreeRoot
* @ORM\Column(name="root", type="integer", nullable=true)
*/
private $root;
I don't think it's possible to mix-and-match, or at least I'm having trouble doing so.
I'm replacing the provided trait with my own, but bringing up the issue here, because with PHP8 out and Doctrine 3 imminent (and Doctrine 2.9 out), maybe you'd consider a major version bump of this bundle, like you did when you originally forked it from stof.
Is there a way to used Gedmo attributes now, e.g.
#[Gedmo\TreeRoot]
The mechanics of php8 attribute support are pretty straightforward, but the decision about versioning is a bit trickier.
I would love to see support for PHP 8 + Symfony 6 added as well!
So is this fork still necessary? The upstream supports SY6 and PHP8. If my history is correct, antishov created this because stof hadn't updated it for a long time, but recently when I was testing something with Sy6 I switched back to stof's repo and didn't run into any issues.
If there are improvements in this fork, maybe now they can be submitted as PR's?
On Mon, Dec 6, 2021 at 6:19 PM Jon Belelieu @.***> wrote:
I would love to see support for PHP 8 + Symfony 6 added as well!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/antishov/StofDoctrineExtensionsBundle/issues/29#issuecomment-987349616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEXIQIF3VDYC3UHP7FWTQLUPVAITANCNFSM46TI7TPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
It appears that this package is abandoned whereas stof's is being actively updated. Do you happen to know if the original issues which led to the fork have been resolved? Ideally this package would be updated for simplicity, but it doesn't seem like it's in the cards.
FWIW, doctrine-extensions only supports attributes for 3 extensions right now, and Tree isn't one of them :-(
But it's on the todo list:
https://github.com/doctrine-extensions/DoctrineExtensions/issues/2235
With the latest (3.5) release the attribute support is complete
https://github.com/doctrine-extensions/DoctrineExtensions/releases/tag/v3.5.0