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\EventDispatcherCode
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';
}