-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The DualReader can handle only one of them #10
Comments
I can fix it here... shall I send PR? |
@TomasVotruba Yes! Thanks. But before that let me explain why I was doing it this way. |
No problem. For us it's only important not to break previous behavior, which now happened. |
When supporting PHP8, I assumed that both annotations and attributes would be added as follows. /**
* @Foo
*/
#[Foo]
class Fake
{
} The reason why only one of them is read is for performance. There is no performance loss (PHP source parsing cost) for the dual reader when you start with a mixed library of php7 and php8 attributes and end up with "only" php8 attributes. This was the way I envisioned it to be used, but I would like to address your case as well. For this, we need two readers. I would like to change your usage to the default "DualReader" and give the current reader a different name, what do you think? |
Hmm, probably not a good idea. |
In this case I would expected 2 /**
* @Foo
*/
#[Foo]
class Fake
{
} /**
* @Foo
* @Foo
*/
class Fake
{
} #[Foo]
#[Foo]
class Fake
{
} They are all equal, just with different syntax. |
I'm on it 👍 :) |
Please do it! |
From contributte/apitte#165 (review)
The text was updated successfully, but these errors were encountered: