src/Valkyrja/Debug/Debug.php
public static function enable(int $errorReportingLevel = E_ALL, bool $displayErrors = false): void
    {
        // If debug is already enabled
        if (static::$enabled) {
            // Don't do things twice
            return;
        }

        // Debug is enabled
        static::$enabled = true;

        // The exception handler
        $exceptionHandler = new ExceptionHandler($displayErrors);
        // The error handler
        $errorHandler = new ErrorHandler();

        // Set the error reporting level
        error_reporting($errorReportingLevel);

        // Set the error handler
        set_error_handler(
            [
                $errorHandler,
                'handleError',
            ]
        );

        // Set the exception handler
        set_exception_handler(
            [
                $exceptionHandler,
                'handleException',
            ]
        );

        // Register a shutdown function
        register_shutdown_function(
            [
                $exceptionHandler,
                'handleShutdown',
            ]
        );
    }
public static function enable(int $errorReportingLevel = E_ALL, bool $displayErrors = false): void
    {
        // If debug is already enabled
        if (static::$enabled) {
            // Don't do things twice
            return;
        }

        // Debug is enabled
        static::$enabled = true;

        // The exception handler
        $exceptionHandler = new ExceptionHandler($displayErrors);
        // The error handler
        $errorHandler = new ErrorHandler();

        // Set the error reporting level
        error_reporting($errorReportingLevel);

        // Set the error handler
        set_error_handler(
            [
                $errorHandler,
                'handleError',
            ]
        );

        // Set the exception handler
        set_exception_handler(
            [
                $exceptionHandler,
                'handleException',
            ]
        );

        // Register a shutdown function
        register_shutdown_function(
            [
                $exceptionHandler,
                'handleShutdown',
            ]
        );
    }
Enable debug mode.

@param int  $errorReportingLevel [optional] The error reporting level
@param bool $displayErrors       [optional] Whether to display errors

@return void