Skip to content

Commit

Permalink
feat(base): support higer order messaging [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 19, 2018
1 parent 5b45c7c commit 0b142f4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/UnderscoreBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 0b142f4

Please sign in to comment.