public function fatal($error, array $context = array())
    {
        $code = 0;
        if (is_object($error) && is_a($error, 'Exception')) {
            /** @var Exception $error */
            $this->debug(get_class($error) . ' caught in ' . $error->getFile() . ':' . $error->getLine());
            $this->debug($error->getTraceAsString());
            $code = $error->getCode();
            $error = $error->getMessage();

        }
        if (!$code) {
            $code = Exception::E_ANY;
        }

        $this->critical($error, $context);
        exit($code);
    }
public function fatal($error, array $context = array())
    {
        $code = 0;
        if (is_object($error) && is_a($error, 'Exception')) {
            /** @var Exception $error */
            $this->debug(get_class($error) . ' caught in ' . $error->getFile() . ':' . $error->getLine());
            $this->debug($error->getTraceAsString());
            $code = $error->getCode();
            $error = $error->getMessage();

        }
        if (!$code) {
            $code = Exception::E_ANY;
        }

        $this->critical($error, $context);
        exit($code);
    }
public function fatal ( $ error , array $ context = array ( ) ) { $ code = 0 ; if ( is_object ( $ error ) && is_a ( $ error , 'Exception' ) ) { /** @var Exception $error */ $ this -> debug ( get_class ( $ error ) . ' caught in ' . $ error -> getFile ( ) . ':' . $ error -> getLine ( ) ) ; $ this -> debug ( $ error -> getTraceAsString ( ) ) ; $ code = $ error -> getCode ( ) ; $ error = $ error -> getMessage ( ) ; } if ( ! $ code ) { $ code = Exception :: E_ANY ; } $ this -> critical ( $ error , $ context ) ; exit ( $ code ) ; }
Exits the program on a fatal error

@param \Exception|string $error either an exception or an error message
@param array $context
Exits the program on a fatal error