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

Breadcrumb

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

function EventDispatcher::getCallbackIdentifier

Parameters

callable $cb DO NOT MOVE TO TYPE HINT as private autoload callbacks are not technically callable:

File

vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php, line 679

Class

EventDispatcher
The Event Dispatcher.

Namespace

Composer\EventDispatcher

Code

private function getCallbackIdentifier($cb) : string {
    if (is_string($cb)) {
        return 'fn:' . $cb;
    }
    if (is_object($cb)) {
        return 'obj:' . spl_object_hash($cb);
    }
    if (is_array($cb)) {
        return 'array:' . (is_string($cb[0]) ? $cb[0] : get_class($cb[0]) . '#' . spl_object_hash($cb[0])) . '::' . $cb[1];
    }
    // not great but also do not want to break everything here
    return 'unsupported';
}

API Navigation

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