public function on($hook, $object = null, $default_hook = false)
{
if (!$object) {
$object = $this->owner;
}
if (!$default_hook) {
$this->custom_hook = true;
}
$this->has_hook = true;
$that = $this;
$object->addHook($hook, function ($m) use($default_hook, $that) {
if ($that->custom_hook && $default_hook) {
return;
}
$that->applyRulesets();
});
}