src/class/ShutdownHandler.php
public static function register(LoggerInterface $logger = null, $cfg = null) {
            self::$registered = true;
            $class = get_called_class();
            $handler = new $class($logger, $cfg);

            register_shutdown_function([$handler, 'handle']);
            self::$lastRegisteredHandler = &$handler;

            return $handler;
        }
public static function register(LoggerInterface $logger = null, $cfg = null) {
            self::$registered = true;
            $class = get_called_class();
            $handler = new $class($logger, $cfg);

            register_shutdown_function([$handler, 'handle']);
            self::$lastRegisteredHandler = &$handler;

            return $handler;
        }
public static function register ( LoggerInterface $ logger = null , $ cfg = null ) { self :: $ registered = true ; $ class = get_called_class ( ) ; $ handler = new $ class ( $ logger , $ cfg ) ; register_shutdown_function ( [ $ handler , 'handle' ] ) ; self :: $ lastRegisteredHandler = & $ handler ; return $ handler ; }
Registers the shutdown handler

@author Art <a.molcanovas@gmail.com>

@param LoggerInterface $logger If provided, this will be used to log shutdowns.
@param AbstractConfig  $cfg    Configuration options

@return self
Registers the shutdown handler