question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support of PHP 8 attributes in Doctrine ORM

See original GitHub issue

Just yesterday Doctrine 2.9 has been released: https://www.doctrine-project.org/2021/05/24/orm2.9.html

The major new feature is support of PHP 8 attributes for ORM data mapping in addition to already existing PHPDoc annotations.

But the plugin hasn’t full support of PHP 8 attributes in Doctrine now.

Example 1. Value specified in mappedBy parameter of OneToMany association mapping is recognized as entity field and available for “Go to” if the mapping is writted in PHPDoc. But the value is not recognized as field if the mapping is written in attributes.

image

Example 2. Custom repository type is not inferred from EntityManager::getRepository() if entity is mapped in attributes.

image image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Haehnchencommented, Sep 9, 2021

first general attribute metadata support added via: https://github.com/Haehnchen/idea-php-symfony2-plugin/pull/1701

2reactions
Haehnchencommented, Jun 29, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Doctrine ORM 2.9 with Attributes, Typed Properties, more
We have released a new minor version 2.9 of Doctrine ORM, the first version with support for using PHP 8 Attributes as a...
Read more >
How can i use php8 attributes instead of annotations in ...
As @Seb33300 says, yes, it's now possible in Doctrine ORM 2.9. But for Symfony you need to do a little bit more than...
Read more >
Doctrine annotations VS PHP8 attributes - GraphQLite
PHP 8 attributes do not support nested attributes (unlike Doctrine annotations). This means there is no equivalent to the annotations attribute ...
Read more >
Support of PHP 8 attributes · Issue #2363 - GitHub
This is an issue to keep track the work needed to fully support PHP 8 attributes. In 3.2.0 we added support to use...
Read more >
Working with attributes | PHP 8 Programming Tips, Tricks and ...
In order to address hidden dangers, in PHP 8 a new Attribute class is provided. Instead of using DocBlocks with annotations, developers can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found