src/Util/Closure/Serializer.php
public static function unserialize($serialized, string $type = null): \Closure
    {
        self::$serializeType = $type;
        $unserialized = Serialize::decode($serialized, $type);

        if (!$unserialized instanceof SerializableClosure) {
            throw new \RuntimeException(
                'The closure did not unserialize to a SuperClosure.'
            );
        }

        return $unserialized->getClosure();
    }
public static function unserialize($serialized, string $type = null): \Closure
    {
        self::$serializeType = $type;
        $unserialized = Serialize::decode($serialized, $type);

        if (!$unserialized instanceof SerializableClosure) {
            throw new \RuntimeException(
                'The closure did not unserialize to a SuperClosure.'
            );
        }

        return $unserialized->getClosure();
    }
public static function unserialize ( $ serialized , string $ type = null ) : \ Closure { self :: $ serializeType = $ type ; $ unserialized = Serialize :: decode ( $ serialized , $ type ) ; if ( ! $ unserialized instanceof SerializableClosure ) { throw new \ RuntimeException ( 'The closure did not unserialize to a SuperClosure.' ) ; } return $ unserialized -> getClosure ( ) ; }
Takes a serialized closure, performs the unserialization, and then
extracts and returns a the Closure object.

@param string      $serialized Serialized closure.
@param string|null $type

@throws \RuntimeException if unserialization fails.
@return \Closure Unserialized closure.
Takes a serialized closure performs the unserialization and then extracts and returns a the Closure object .