You are here

private function CachedDoubler::generateClassId 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::generateClassId()

Parameters

ReflectionClass $class:

ReflectionClass[] $interfaces:

Return value

string

1 call to CachedDoubler::generateClassId()
CachedDoubler::createDoubleClass in vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
Creates double class and returns its FQN.

File

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

Class

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

Namespace

Prophecy\Doubler

Code

private function generateClassId(ReflectionClass $class = null, array $interfaces) {
  $parts = array();
  if (null !== $class) {
    $parts[] = $class
      ->getName();
  }
  foreach ($interfaces as $interface) {
    $parts[] = $interface
      ->getName();
  }
  sort($parts);
  return md5(implode('', $parts));
}