/** * Execute dispatcher's default handler * * @return false * @access protected */ protected function defaultHandler() { if ($this->runExtensions(self::BEFORE_DEFAULT, $this->result)) { $status = $this->result->getStatus(); $handler = $this->getHandler($status); if ($handler) { $handler($this->result); } else { echo Message::get(Message::DEBUG_NEED_HANDLER, $status); } $this->runExtensions(self::AFTER_DEFAULT, $this->result); } return false; }
/** * Set collector level handler if result has no handler set yet * * @param ResultInterface $result desc * @return self * @access protected */ protected function setCollectorHandler(ResultInterface $result) { $status = $result->getStatus(); if (is_null($result->getHandler()) && $this->getHandler($status)) { // debug message $this->debug(Message::get(Message::DEBUG_SET_C_HANDLER, get_class($this), $status)); $result->setHandler($this->getHandler($status)); } return $this; }
/** * {@inheritDoc} */ public function __invoke(ResultInterface $result, $stage = '') { echo sprintf("%s(%d) ", $stage, $result->getStatus()); return true; }