/** * Shutdown handler callback. * * Called when the PHP process has finished running. Should only be called * internally by PHP's register_shutdown_function. * * @return void */ public function shutdownHandler() { // Get last error $lastError = error_get_last(); // Check if a fatal error caused this shutdown if (!is_null($lastError) && Bugsnag_ErrorTypes::isFatal($lastError['type']) && $this->config->autoNotify && !$this->config->shouldIgnoreErrorCode($lastError['type'])) { $error = Bugsnag_Error::fromPHPError($this->config, $this->diagnostics, $lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], true); $error->setSeverity('error'); $this->notify($error); } // Flush any buffered errors if ($this->notification) { $this->notification->deliver(); $this->notification = null; } }
public function testShouldNotIgnore() { $this->config->errorReportingLevel = E_ALL; $this->assertfalse($this->config->shouldIgnoreErrorCode(E_NOTICE)); }