public static function register($mode = 0)
    {
        if (self::$isRegistered) {
            return;
        }

        self::$utilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\';

        $handler = new self();
        $oldErrorHandler = set_error_handler([$handler, 'handleError']);

        if (null !== $oldErrorHandler) {
            restore_error_handler();

            if ([self::$utilPrefix.'ErrorHandler', 'handleError'] === $oldErrorHandler) {
                restore_error_handler();
                self::register($mode);
            }
        } else {
            $handler->mode = $mode;
            self::$isRegistered = true;
            register_shutdown_function([$handler, 'shutdown']);
        }
    }
public static function register($mode = 0)
    {
        if (self::$isRegistered) {
            return;
        }

        self::$utilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\';

        $handler = new self();
        $oldErrorHandler = set_error_handler([$handler, 'handleError']);

        if (null !== $oldErrorHandler) {
            restore_error_handler();

            if ([self::$utilPrefix.'ErrorHandler', 'handleError'] === $oldErrorHandler) {
                restore_error_handler();
                self::register($mode);
            }
        } else {
            $handler->mode = $mode;
            self::$isRegistered = true;
            register_shutdown_function([$handler, 'shutdown']);
        }
    }
public static function register ( $ mode = 0 ) { if ( self :: $ isRegistered ) { return ; } self :: $ utilPrefix = class_exists ( 'PHPUnit_Util_ErrorHandler' ) ? 'PHPUnit_Util_' : 'PHPUnit\Util\\' ; $ handler = new self ( ) ; $ oldErrorHandler = set_error_handler ( [ $ handler , 'handleError' ] ) ; if ( null !== $ oldErrorHandler ) { restore_error_handler ( ) ; if ( [ self :: $ utilPrefix . 'ErrorHandler' , 'handleError' ] === $ oldErrorHandler ) { restore_error_handler ( ) ; self :: register ( $ mode ) ; } } else { $ handler -> mode = $ mode ; self :: $ isRegistered = true ; register_shutdown_function ( [ $ handler , 'shutdown' ] ) ; } }
Registers and configures the deprecation handler.

The mode is a query string with options:
- "disabled" to disable the deprecation handler
- "verbose" to enable/disable displaying the deprecation report
- "max" to configure the number of deprecations to allow before exiting with a non-zero
status code; it's an array with keys "total", "self", "direct" and "indirect"

The default mode is "max[total]=0&verbose=1".

The mode can alternatively be "/some-regexp/" to stop the test suite whenever
a deprecation message matches the given regular expression.

@param int|string|false $mode The reporting mode, defaults to not allowing any deprecations
Registers and configures the deprecation handler .