Coder Social home page Coder Social logo

Comments (8)

koriym avatar koriym commented on June 10, 2024 1

@TomasVotruba Yes! Thanks. But before that let me explain why I was doing it this way.

from koriym.attributes.

koriym avatar koriym commented on June 10, 2024 1

Hmm, probably not a good idea.
Let's just make your changes, shall we?

from koriym.attributes.

TomasVotruba avatar TomasVotruba commented on June 10, 2024 1

Hmm, probably not a good idea.
Let's just make your changes, shall we?

I'm on it 👍 :)

from koriym.attributes.

TomasVotruba avatar TomasVotruba commented on June 10, 2024

I can fix it here... shall I send PR?

from koriym.attributes.

TomasVotruba avatar TomasVotruba commented on June 10, 2024

No problem. For us it's only important not to break previous behavior, which now happened.

from koriym.attributes.

koriym avatar koriym commented on June 10, 2024

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?

from koriym.attributes.

TomasVotruba avatar TomasVotruba commented on June 10, 2024

When supporting PHP8, I assumed that both annotations and attributes would be added as follows.

In this case I would expected 2 Foo classes. As in these cases:

/**
 * @Foo
 */
#[Foo]
class Fake
{
}
/**
 * @Foo
 * @Foo
 */
class Fake
{
}
#[Foo]
#[Foo]
class Fake
{
}

They are all equal, just with different syntax.

from koriym.attributes.

koriym avatar koriym commented on June 10, 2024

I can fix it here... shall I send PR?

Please do it!

from koriym.attributes.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.