/** * Make entity return callback function. * Callback function upon invoking will receive same list of parameters * as original one would. * * @param Closure $callback * @return PStub_Stubber */ public function returnCallback(Closure $callback) { $index = PStub_Stubber_Container::addMethod($callback); $this->usedIndexes['callback'][] = $index; $code = str_replace('%index%', $index, self::$templates['callback']); $this->stub($code); return $this; }