Skip to content

Commit 0b142f4

Browse files
committed
feat(base): support higer order messaging [wip]
1 parent 5b45c7c commit 0b142f4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/UnderscoreBase.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,23 @@ public function __call($method, $args)
350350
throw new UnderscoreException("The mixin with name '$method' is not defined");
351351
}
352352

353+
/**
354+
* Facilitates the use of Higher Order Messaging.
355+
*
356+
* @param string $method
357+
*
358+
* @return self
359+
*/
360+
public function __get($method)
361+
{
362+
// For now no mixins in HOM :)
363+
if (!\method_exists($this, $method)) {
364+
throw new UnderscoreException("The '$method' is not defined");
365+
}
366+
367+
return new HigherOrderMessage($this, $method);
368+
}
369+
353370
/**
354371
* Get string value (JSON representation) of this instance.
355372
*

0 commit comments

Comments
 (0)