function LazyDouble::getInstance
Creates double instance or returns already created one.
Return value
T&DoubleInterface
File
-
vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ LazyDouble.php, line 138
Class
- LazyDouble
- Lazy double. Gives simple interface to describe double before creating it.
Namespace
Prophecy\DoublerCode
public function getInstance() {
if (null === $this->double) {
if (null !== $this->arguments) {
return $this->double = $this->doubler
->double($this->class, $this->interfaces, $this->arguments);
}
$this->double = $this->doubler
->double($this->class, $this->interfaces);
}
return $this->double;
}