/** * * @param Exception $e * * @return array */ public function formatException(Exception $e) { return array('class' => $e instanceof ErrorException ? fpErrorNotifierErrorCode::getName($e->getSeverity()) : get_class($e), 'code' => $e->getCode(), 'severity' => $e instanceof ErrorException ? $e->getSeverity() : 'null', 'message' => $e->getMessage(), 'file' => "File: {$e->getFile()}, Line: {$e->getLine()}", 'trace' => $e->getTraceAsString()); }
public function testGetName() { $this->assertEquals('E_CORE_ERROR', fpErrorNotifierErrorCode::getName(fpErrorNotifierErrorCode::E_CORE_ERROR)); $this->assertEquals('E_UNKNOWN', fpErrorNotifierErrorCode::getName('FOO')); }