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 method getAsString #58

Open
gsouf opened this issue Oct 13, 2015 · 4 comments
Open

Add method getAsString #58

gsouf opened this issue Oct 13, 2015 · 4 comments
Labels

Comments

@gsouf
Copy link
Contributor

gsouf commented Oct 13, 2015

Currently there is a method AnnotationBag::getAsArray()
That's very convenient when we want to make sure to retrieve an array.

What's about adding a method
AnnotationBag::getAsString() or AnnotationBag::getAsRawString()
to get the annotation value as a string. Even if it's in array or object annotation,
we sometime want to get this value as the raw original string.

We could do that by changing the parser. But sometime we can need both of the ouput
depending on the annotation name.

What's your opinion ?

@marcioAlmada
Copy link
Owner

It will depend on how much change it would require on public classes.

@gsouf
Copy link
Contributor Author

gsouf commented Oct 14, 2015

And what's about publishing it for v3 ?

@marcioAlmada
Copy link
Owner

For v3 it would be ok as long as it's not a huge BC break on the AnnotationsBag public API, which I believe is perfectly possible to do with internal changes only.

@gsouf
Copy link
Contributor Author

gsouf commented Nov 2, 2015

That would actually require to change the constructor and the set methods of the annotation bag, because we need to pass both of the original string and the parsed one.

An other approach would be to pass only the raw string, and the annotationBag would be responsible to transform the raw string into the good type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants