/** * Handle error if it's in console environment. * * @return integer */ public function handle() { if (!Debugger::isCli()) { return Handler::DONE; } $this->printException($this->getException()); if ($this->exit !== null) { exit(intval($this->exit)); } return Handler::DONE; }
public function testIsCli() { // tests are ran from CLI so this should be true $this->assertTrue(Debugger::isCli()); $this->assertFalse(Debugger::isWebRequest()); }