JsonLD
JsonLD copied to clipboard
Convenience methods on Node interface
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.
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.