-
Notifications
You must be signed in to change notification settings - Fork 62
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
Convenience methods on Node interface #60
Comments
Yes, such helper methods (and a PR) would certainly be welcome. I’m a bit on the fence about hasProperty as checking for null is more or less the same as checking for true/false. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to have some additional convenience methods on Node objects, e.g. an
hasType(string $type)
method that can check if the node is of a certain type and simply return true or false or anhasProperty(string $property)
which can be used as a pre-check beforegetProperty
to prevent a fatal error (callinghasValue()
on a non-object).Are you interested in accepting pull requests with helper methods like this?! If so I would fork and implement them.
The text was updated successfully, but these errors were encountered: