Sets/Unsets fatal error catch function. It is used to catch fatal errors

@param boolean $catchfatals (true|false) to set or unset fatals catch
768859
public function setCatchFatals($catchfatals = true) {
		if ($catchfatals && !$this->fatalhandlerset) {
			register_shutdown_function(array($this, 'fatalsHandler'));
			$this->fatalhandlerset = true;
		} elseif($this->fatalhandlerset) {
			$this->fatalhandlerset = false;
		}
	}
1043940
public static function setErrorHandler($errorHandler)
    {
        # Get the current error handler to make sure it's set,
        # since it will need to be used if the passed error
        # handler is invalid
        $currentErrorHandler = static::getErrorHandler();
        
        if (!($errorHandler instanceof ErrorHandlerInterface)) {
            $message = 'The error handler argument is not valid, because it doesn\'t implement '
                .ErrorHandlerInterface::class.'.';
                $code = ErrorHandlerInterface::INVALID_ARGUMENT;
            $currentErrorHandler->throwException($message, $code);
        } // @codeCoverageIgnore
        self::$errorHandler = $errorHandler;
    }
781298
public function handleFatal()
    {
        $error = error_get_last();
        if ($error) {
            switch ($error['type']) {
                case E_ERROR:
                case E_PARSE:
                case E_CORE_ERROR:
                case E_COMPILE_ERROR:
                case E_USER_ERROR:
                    $this->logger->log(
                        $this->map[$error['type']],
                        'Fatal error (' . self::$strings[$error['type']] . '): ' . $error['message'],
                        array(
                            'file' => $error['file'],
                            'line' => $error['line'],
                            'code' => $error['type']
                        )
                    );
            }
        }
    }
773730
public function handleFatalError()
    {
        unset($this->_memoryReserve);
        
        $error = error_get_last();
        
        if (static::isFatalError($error)) {
            $exception = new ErrorException($error['message'], $error['type'], $error['type'], $error['file'], $error['line']);
            $this->exception = $exception;

            $this->logException($exception);
            
            /*
            if ($this->options['discard_output']) {
                $this->clearOutput();
            }
            
            $this->renderException($exception);
            */
            //debug_print_backtrace();
            
            exit(1);
        }
    }
41504
private function _install($handlers) {
		if (in_array('error', $handlers)) {
			set_error_handler(array($this, 'onError'), error_reporting());
		}

		if (in_array('exception', $handlers)) {
			set_exception_handler(array($this, 'onException'));
		}

		if (in_array('fatal', $handlers)) {
			register_shutdown_function(array($this, 'onShutdown'));
		}
	}
800110
public void setFatalClass(java.lang.String fatalClass) {
        getStateHelper().put(PropertyKeys.fatalClass, fatalClass);
    }
853725
public function throwValidationExceptionsOnDispatch($bool = null)
    {
        if ($bool === null) {
            return $this->throwValidationExceptionsOnDispatch;
        } else {
            $this->throwValidationExceptionsOnDispatch = $bool;
        }
    }
759907
public function setErrorsLogLevel($errorsLogLevel)
    {
        if (!in_array($errorsLogLevel, $this->getAvailableErrorsLogLevel())) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Unsupported errors log level "%s". Use one of supported log levels: [%s].',
                    $errorsLogLevel,
                    implode(', ', $this->getAvailableErrorsLogLevel())
                )
            );
        }

        $this->errorsLogLevel = $errorsLogLevel;
    }
914785
public function extractFatalErrorAndCallHandler(IErrorHandler $handler) {
        $error = $this->getLastError();

        if ($error === null) {
            return;
        }

        if ( ! ErrorType::isFatal(array_get($error, 'type'))) {
            return;
        }

        $error = new FatalError(
            array_get($error, 'type'),
            array_get($error, 'message'),
            array_get($error, 'file'),
            array_get($error, 'line')
        );

        return $handler->handleFatalError($error);
    }
135041
public function unregisterFatalAction()
    {
        $this->fatalShouldActive = false;

        if ($this::$krexxFatal === null) {
            // There is no fatal error handler to begin with.
            return $this;
        }

        // Now we need to tell the shutdown function, that is must
        // not do anything on shutdown.
        $this::$krexxFatal->setIsActive(false);
        unregister_tick_function(array($this::$krexxFatal, 'tickCallback'));
        return $this;
    }
1085826
public function throwError($msg)
    {
        if ($this->ignoreErrors) {
            return;
        }

        if (func_num_args() > 1) {
            $msg = call_user_func_array('sprintf', func_get_args());
        }

        $line = $this->sourceLine;
        $msg = "$msg: line: $line";

        throw new CompilerException($msg);
    }
304206
public function handleFatalError()
    {
        $e = error_get_last();
        if ($e !== null && in_array($e['type'], $this->fatalErrorTypes)) {
            $event = new CErrorEvent($this, 500, 'Fatal error: ' . $e['message'], $e['file'], $e['line']);
            $this->handle($event);
            //Yii::app()->end(1); // end with abnormal ending
        }
    }
177015
public function fatal()
    {
        $msg = error_get_last();

        if ($msg) {
            if (X_DEBUG && PHP_SAPI !='cli') {
                $error = self::getComponent('errorHandler');
                $error->displayFatal($msg);
            } else {
                echo $msg['message'];
            }
        }
    }
751612
public function setErrorHandler()
    {
        set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
            throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
        });
    }
260275
protected void handleFatalError (Object causer, Error error)
    {
        if (_fatalThrottle.throttleOp()) {
            throw error;
        }
        log.warning("Fatal error caused by '" + causer + "': " + error, error);
    }
390193
public function errors(int $statusCode, string $message, $errors = null): void
    {
        $this->setStatusCode($statusCode);
        $this->setMessage($message);
        $this->setErrors($errors);

        throw new ApiException($this);
    }
512790
public function setErrors($errors)
    {
        $this->errors = strtolower((string) $errors);

        $message = sprintf("Set errors flag to [%s].", $this->errors);
        $this->log($message, Project::MSG_DEBUG);
    }