My first commit of codes

This commit is contained in:
sujitprasad
2015-05-01 13:13:01 +05:30
parent 4c8e5096f1
commit a6e5a69348
8487 changed files with 1317246 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php namespace SuperClosure;
use SuperClosure\Exception\ClosureUnserializationException;
/**
* Interface for a serializer that is used to serialize Closure objects.
*/
interface SerializerInterface
{
/**
* Takes a Closure object, decorates it with a SerializableClosure object,
* then performs the serialization.
*
* @param \Closure $closure Closure to serialize.
*
* @return string Serialized closure.
*/
public function serialize(\Closure $closure);
/**
* Takes a serialized closure, performs the unserialization, and then
* extracts and returns a the Closure object.
*
* @param string $serialized Serialized closure.
*
* @throws ClosureUnserializationException if unserialization fails.
* @return \Closure Unserialized closure.
*/
public function unserialize($serialized);
/**
* Retrieves data about a closure including its code, context, and binding.
*
* The data returned is dependant on the `ClosureAnalyzer` implementation
* used and whether the `$forSerialization` parameter is set to true. If
* `$forSerialization` is true, then only data relevant to serializing the
* closure is returned.
*
* @param \Closure $closure Closure to analyze.
* @param bool $forSerialization Include only serialization data.
*
* @return \Closure
*/
public function getData(\Closure $closure, $forSerialization = false);
}