class ResponseClassPrototype extends PrototypeAbstract implements Clonable {
private $proto = null;
public function __construct(Response $class)
{
$this->proto = $class;
}
public function getClone()
{
return clone $this->proto();
};
public function json()
{
$response = $this->getClone();
$response->setHeader('Content-type', 'application/json');
return $response;
}
//function html();
// ...
}