Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CachedDoubler.php

function CachedDoubler::generateClassId

Parameters

ReflectionClass<object>|null $class:

ReflectionClass<object>[] $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 45

Class

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

Namespace

Prophecy\Doubler

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal