public function __call($method, $args)
{
if ($method == 'create') {
return new self(self::create($this->class));
}
if (!isset(self::$extensions[$method])) {
throw new \Exception(sprintf('Unknown extension %s', $method));
}
if (!self::$extensions[$method] instanceof \Closure) {
throw new \Exception(sprintf('Extension %s must be an instance of Closure', $method));
}
$extension = self::$extensions[$method];
foreach (call_user_func_array($extension, $args) as $property => $value) {
$this->quip->extended[$property] = $value;
}
return $this;
}