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

Feature/attributes #19

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

Feature/attributes #19

wants to merge 14 commits into from

Conversation

toooni
Copy link
Contributor

@toooni toooni commented Aug 14, 2023

These changes will require a new major version.

I've implemented this bundle to support attributes instead of annotations. Since this bundle seems to be feature-complete anyway, I do not think it would make much sense to have additional complexity to support both (annotations and attributes) at the same time. <PHP8 users or users who want annotations can just use an older version.

I've based this PR on my other PR #18 which should be merged first.

@coveralls
Copy link

coveralls commented Aug 14, 2023

Coverage Status

coverage: 100.0%. remained the same when pulling 23e70f6 on toooni:feature/attributes into 486573d on w3c:main.

@toooni toooni changed the title Feature/attributes WIP: Feature/attributes Aug 14, 2023
@toooni toooni changed the title WIP: Feature/attributes Feature/attributes Aug 15, 2023
Copy link
Contributor

@jean-gui jean-gui left a comment

Choose a reason for hiding this comment

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

This looks mostly good, I noticed a couple functions that should be renamed.
Can you rebase your code as well?

FYI, I have created a branch named sf4 for the older code.

* @return object|null object of same class as $attributeClass or null if no attribute is found
* @throws ReflectionException
*/
public function getAnnotation(string $class, string $attributeClass): ?object
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename that to getAttribute?

* @return object|null object of same class as $attributeClass or null if no attribute is found
* @throws ReflectionException if the field does not exist
*/
public function getPropertyAnnotation(ClassMetadata $classMetadata, string $field, string $attributeClass): ?object
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename to getPropertyAttribute?

class AttributeGetter
{
/**
* Get a class-level annotation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Get a class-level annotation
* Get a class-level attribute

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

3 participants