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

Class name validator #8

Closed
miromichalicka opened this issue Jan 31, 2018 · 3 comments
Closed

Class name validator #8

miromichalicka opened this issue Jan 31, 2018 · 3 comments

Comments

@miromichalicka
Copy link

Hi,
is there any reason why in validateClassName method you require on the second place only 0 from numbers? Referenced doc says nothing about that.

@Chi-teck
Copy link
Owner

That's a bug.

@miromichalicka
Copy link
Author

Would the correct solution be rollback to regexp from php documentation? I can open PR with that.

@Chi-teck
Copy link
Owner

Chi-teck commented Jan 31, 2018

PHP allows underscores and Unicode characters in class names. I did not find rules about this in Drupal coding standards but Drupal core classes do not use them.
So the regexp could be something like this /^[A-Z][a-zA-Z0-9]+$/.

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

No branches or pull requests

2 participants