You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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: