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

Convenience methods on Node interface #60

Open
LukasRos opened this issue Aug 10, 2014 · 1 comment
Open

Convenience methods on Node interface #60

LukasRos opened this issue Aug 10, 2014 · 1 comment

Comments

@LukasRos
Copy link
Contributor

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 an hasProperty(string $property) which can be used as a pre-check before getProperty to prevent a fatal error (calling hasValue() on a non-object).

Are you interested in accepting pull requests with helper methods like this?! If so I would fork and implement them.

@lanthaler
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants