protected static function toggleSerializeClosure(array &$options, $key)
    {
        if (!isset($options[$key])) {
            return;
        }
        $serializer = Util::getClosureSerializer();
        if (is_callable($options[$key])) {
            $options[$key] = (string) $serializer->serialize($options[$key]);
        } elseif (is_string($options[$key])) {
            $options[$key] = $serializer->unserialize($options[$key]);
        }
    }
protected static function toggleSerializeClosure(array &$options, $key)
    {
        if (!isset($options[$key])) {
            return;
        }
        $serializer = Util::getClosureSerializer();
        if (is_callable($options[$key])) {
            $options[$key] = (string) $serializer->serialize($options[$key]);
        } elseif (is_string($options[$key])) {
            $options[$key] = $serializer->unserialize($options[$key]);
        }
    }
protected static function toggleSerializeClosure ( array & $ options , $ key ) { if ( ! isset ( $ options [ $ key ] ) ) { return ; } $ serializer = Util :: getClosureSerializer ( ) ; if ( is_callable ( $ options [ $ key ] ) ) { $ options [ $ key ] = ( string ) $ serializer -> serialize ( $ options [ $ key ] ) ; } elseif ( is_string ( $ options [ $ key ] ) ) { $ options [ $ key ] = $ serializer -> unserialize ( $ options [ $ key ] ) ; } }
Serialize or deserialize the specified closure and then replace the original value.

@param array      $options
@param int|string $key
Serialize or deserialize the specified closure and then replace the original value .