FancyClosure

A utility class... that I don't think I'm actually using. Idk.

Fancy closures enable binding of paramaters to a callable and inspection of callables, whether as ['\\StaticClass','functionName'], [$object, 'methodName'], or $anonymousFunction = function(){}.

Example:

$cat = new \Funny\Cat();  
$loudness = 7;  
$closure = new \Lia\Utility\FancyClosure([$cat, 'purr'], [$loudness]);  
$closure(); // calls $cat->purr($loudness);  
  
  
$closure->funcName === 'purr';  
$closure->object === $cat;  
$closure->class === 'Funny\\Cat'; //it prints with a single slash, but backslashes are generally better off being escaped in my experience  
$closure->isStatic === false; // would be true if using ['Funny\Cat', 'purr'] instead of [$cat, 'purr']  
$closure->isAnonymous === false; // would be true for function(){echo 'Kindness can be anonymous too.';}  
$closure->function === null; // would be the anonymous function, if you had passed a function instead of an `[$obj, 'funcName']` callable  
  
$closure->origCallable === [$cat, 'purr']; //just the first arg you pass to the constructor  
$closure->bound === [$loudness]; // and this is the 2nd arg