You are here

protected function CachedDoubler::createDoubleClass in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php \Prophecy\Doubler\CachedDoubler::createDoubleClass()

Creates double class and returns its FQN.

Parameters

ReflectionClass $class:

ReflectionClass[] $interfaces:

Return value

string

Overrides Doubler::createDoubleClass

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php, line 39

Class

CachedDoubler
Cached class doubler. Prevents mirroring/creation of the same structure twice.

Namespace

Prophecy\Doubler

Code

protected function createDoubleClass(ReflectionClass $class = null, array $interfaces) {
  $classId = $this
    ->generateClassId($class, $interfaces);
  if (isset($this->classes[$classId])) {
    return $this->classes[$classId];
  }
  return $this->classes[$classId] = parent::createDoubleClass($class, $interfaces);
}