public static function start(): void     // TODO - not this.
    {
        ini_set('display_errors', 1);
        ini_set('track_errors', 1);
        error_reporting(self::$level);

        if (TEST) {
            return;
        }

        /**
         * if you return true from here it will continue script execution from the point of the error..
         * this is not wanted. Die and Exit are equivalent in execution. I ran across a post once that
         * explained how die should signify a complete error with no resolution, while exit has resolution
         * returning 1 rather than 0 in both cases will signify an error occurred
         * @param array $argv
         * @internal param TYPE_NAME $closure
         */
        $closure = function (...$argv) {
            static $count;

            if (empty($count)) {
                $count = 0;
            }
            $count++;

            self::generateLog($argv);

            if (!SOCKET && !APP_LOCAL && CarbonPHP::$setupComplete) {     // TODO - do we really want to reset?
                if ($count > 1) {
                    print 'A recursive error has occurred in (or at least affecting) your $app->defaultRoute();';
                    die(1);
                }
                startApplication(true);
                exit(1);
            }

            /** @noinspection ForgottenDebugOutputInspection
             * TODO - fix this? */
            print_r($argv);
            print "\n\nCarbonPHP Caught This Error.\n\n";
            die(1);

        };
        set_error_handler($closure);
        set_exception_handler($closure);
    }
public static function start(): void     // TODO - not this.
    {
        ini_set('display_errors', 1);
        ini_set('track_errors', 1);
        error_reporting(self::$level);

        if (TEST) {
            return;
        }

        /**
         * if you return true from here it will continue script execution from the point of the error..
         * this is not wanted. Die and Exit are equivalent in execution. I ran across a post once that
         * explained how die should signify a complete error with no resolution, while exit has resolution
         * returning 1 rather than 0 in both cases will signify an error occurred
         * @param array $argv
         * @internal param TYPE_NAME $closure
         */
        $closure = function (...$argv) {
            static $count;

            if (empty($count)) {
                $count = 0;
            }
            $count++;

            self::generateLog($argv);

            if (!SOCKET && !APP_LOCAL && CarbonPHP::$setupComplete) {     // TODO - do we really want to reset?
                if ($count > 1) {
                    print 'A recursive error has occurred in (or at least affecting) your $app->defaultRoute();';
                    die(1);
                }
                startApplication(true);
                exit(1);
            }

            /** @noinspection ForgottenDebugOutputInspection
             * TODO - fix this? */
            print_r($argv);
            print "\n\nCarbonPHP Caught This Error.\n\n";
            die(1);

        };
        set_error_handler($closure);
        set_exception_handler($closure);
    }
public static function start ( ) : void // TODO - not this. { ini_set ( 'display_errors' , 1 ) ; ini_set ( 'track_errors' , 1 ) ; error_reporting ( self :: $ level ) ; if ( TEST ) { return ; } /**
         * if you return true from here it will continue script execution from the point of the error..
         * this is not wanted. Die and Exit are equivalent in execution. I ran across a post once that
         * explained how die should signify a complete error with no resolution, while exit has resolution
         * returning 1 rather than 0 in both cases will signify an error occurred
         * @param array $argv
         * @internal param TYPE_NAME $closure
         */ $ closure = function ( ... $ argv ) { static $ count ; if ( empty ( $ count ) ) { $ count = 0 ; } $ count ++ ; self :: generateLog ( $ argv ) ; if ( ! SOCKET && ! APP_LOCAL && CarbonPHP :: $ setupComplete ) { // TODO - do we really want to reset? if ( $ count > 1 ) { print 'A recursive error has occurred in (or at least affecting) your $app->defaultRoute();' ; die ( 1 ) ; } startApplication ( true ) ; exit ( 1 ) ; } /** @noinspection ForgottenDebugOutputInspection
             * TODO - fix this? */ print_r ( $ argv ) ; print "\n\nCarbonPHP Caught This Error.\n\n" ; die ( 1 ) ; } ; set_error_handler ( $ closure ) ; set_exception_handler ( $ closure ) ; }
ErrorCatcher constructor.
ErrorCatcher constructor .