diff --git a/src/UnderscoreBase.php b/src/UnderscoreBase.php index 226e9bf..76801bb 100644 --- a/src/UnderscoreBase.php +++ b/src/UnderscoreBase.php @@ -350,6 +350,23 @@ public function __call($method, $args) throw new UnderscoreException("The mixin with name '$method' is not defined"); } + /** + * Facilitates the use of Higher Order Messaging. + * + * @param string $method + * + * @return self + */ + public function __get($method) + { + // For now no mixins in HOM :) + if (!\method_exists($this, $method)) { + throw new UnderscoreException("The '$method' is not defined"); + } + + return new HigherOrderMessage($this, $method); + } + /** * Get string value (JSON representation) of this instance. *