private static function registerShutdownFunction(): bool
    {
        self::$startTime = microtime(true);
        register_shutdown_function(
            function () {
                $error = error_get_last();
                if ($error === E_ERROR && count(self::$pathsCreated) > 0) {
                    self::echoDirtyTransactionCleanupCommands();
                }
            }
        );

        return true;
    }