/**
  *
  * @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'));
 }
  /**
   * 
   * @return void
   */
  public function handleFatalError()
  {
    $error = error_get_last();

    $skipHandling = 
      !$error || 
      !isset($error['type']) || 
      !in_array($error['type'], fpErrorNotifierErrorCode::getFatals());
    if ($skipHandling) return;

    $this->freeMemory();
    
    @$this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
    
//    $sfE = new sfException();
//    $sfE->setWrappedException($error);
//    $sfE->printStackTrace();
  }
 /**
  * 
  * @return void
  */
 public function handleFatalError()
 {
     $error = error_get_last();
     $skipHandling = !$error || !isset($error['type']) || !in_array($error['type'], fpErrorNotifierErrorCode::getFatals());
     if ($skipHandling) {
         return;
     }
     $this->freeMemory();
     @$this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
 }
 /**
  *
  * @return bool
  */
 public function handleFatalError()
 {
     $this->freeMemory();
     $error = error_get_last();
     $error = array_merge(array('type' => null, 'message' => null, 'file' => null, 'line' => null), (array) $error);
     if (!in_array($error['type'], fpErrorNotifierErrorCode::getFatals())) {
         return false;
     }
     $this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
     return true;
 }