Skip to content

FQSEN constructor does not accept all valid PHP Class Names #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

Closed
nicmart opened this issue Aug 27, 2016 · 3 comments
Closed

FQSEN constructor does not accept all valid PHP Class Names #7

nicmart opened this issue Aug 27, 2016 · 3 comments
Assignees

Comments

@nicmart
Copy link

nicmart commented Aug 27, 2016

FQSEN constructor accepts only alphanumeric characters, but a lot more are allowed in PHP.
This makes parsing in ReflectionDocBlock fail with valid php class names.

From PHP Documentation:

A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: ^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$.

For example Option«T» is a valid Interface Name, but is not a valid FQSEN name.

In a library I am working on I need to handle this special chars, and to do so I committed a small patch to the regexp in a fork: nicmart@9f3d9ea

If you agree that this is an issue that has to be fixed, I can open a pull request with the fix.

Thanks!

@nicmart
Copy link
Author

nicmart commented Oct 4, 2016

Any update on this? Is the repo still maintained?

@jaapio
Copy link
Member

jaapio commented Apr 24, 2017

Hi @nicmart,

Think you are right about this. I would be happy to accept your PR on this.

@jaapio jaapio added the bug label Apr 24, 2017
jaapio added a commit to jaapio/ReflectionCommon that referenced this issue Apr 30, 2017
Be more specific when checking the first character of the element names.
And allow utf-8 chars in element names according to the php spec.

Fixes phpDocumentor#7.
@jaapio jaapio self-assigned this Apr 30, 2017
@jaapio
Copy link
Member

jaapio commented Apr 30, 2017

Hi @nicmart,

I found some time to fix this. It would be very nice if you could do a review.

Thanks!

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

No branches or pull requests

2 participants