public function type() { if (isset($this->type)) { return $this->type; } $this->type = ''; foreach ($this->callbacks as $type => $callback) { if (call_user_func($callback)) { $this->type = $type; break; } } return $this->type; }