Skip to content
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

Add attribute driver & remove annotations support #124

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

JulienRAVIA
Copy link
Contributor

@JulienRAVIA JulienRAVIA commented Nov 13, 2023

  • Deletion of annotations, AnnotationDriver and doctrine/annotations dependency (i was thinking about keeping them but thought this seemed pretty useless to have both because Annotations are not so PHP8 friendly)
  • Addition of an AttributeDriver, having exactly the same behaviour than AnnotationDriver but handling attributes using Reflection. (its just a basic copy paste with some adjustments ofc)
  • Thinking about an enum class with availables types for Rest\Attribute attribute $type parameter, for adding strict typing

@JulienRAVIA JulienRAVIA marked this pull request as ready for review November 13, 2023 01:36
@JulienRAVIA JulienRAVIA changed the title Add attribute driver & remove annotations Add attribute driver & remove annotations support Nov 13, 2023
Copy link
Member

@jdeniau jdeniau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work ! 👌

There are some small things to change regarding naming.

Can you also document the CHANGELOG.md file ?
As this will require a major bump as this is a breaking change, can you document the migration path for users ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this interface ? It seems unused, no ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interface still seems useless, never tested anywhere, and empty. Can we remove that ?

AbstractPropertyAttribute and AbstractClassAttribute does implements them, and they seems nearly as useless (just to make phpstan happy, no ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MappingAttribute interface has been deleted since.

I can delete abstract classes too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

src/Mapping/Driver/AttributeDriver.php Outdated Show resolved Hide resolved
Tests/Units/EntityRepositoryTest.php Outdated Show resolved Hide resolved
Tests/Units/Mapping/Driver/AttributeDriverTest.php Outdated Show resolved Hide resolved
Tests/Units/Model/SerializerTest.php Outdated Show resolved Hide resolved
Tests/Units/Model/SerializerTest.php Outdated Show resolved Hide resolved
MIGRATION-1.0.md Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
MIGRATION-1.0.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants