src/Hook.php
final private function uniqueId($function)
    {
        if (is_string($function)) {
            return $function;
        }

        if (is_object($function)) {
            // Closures are currently implemented as objects
            $function = [ $function, '' ];
        } elseif (!is_array($function)) {
            $function = [ $function ];
        }

        $function = array_values($function);
        if (is_object($function[0])) {
            return \spl_object_hash($function[0]) . $function[1];
        } elseif (count($function) > 1 || is_string($function[0])) {
            // call as static
            return $function[0] . '::' . $function[1];
        }

        // unexpected result
        return null;
    }
final private function uniqueId($function)
    {
        if (is_string($function)) {
            return $function;
        }

        if (is_object($function)) {
            // Closures are currently implemented as objects
            $function = [ $function, '' ];
        } elseif (!is_array($function)) {
            $function = [ $function ];
        }

        $function = array_values($function);
        if (is_object($function[0])) {
            return \spl_object_hash($function[0]) . $function[1];
        } elseif (count($function) > 1 || is_string($function[0])) {
            // call as static
            return $function[0] . '::' . $function[1];
        }

        // unexpected result
        return null;
    }
final private function uniqueId ( $ function ) { if ( is_string ( $ function ) ) { return $ function ; } if ( is_object ( $ function ) ) { // Closures are currently implemented as objects $ function = [ $ function , '' ] ; } elseif ( ! is_array ( $ function ) ) { $ function = [ $ function ] ; } $ function = array_values ( $ function ) ; if ( is_object ( $ function [ 0 ] ) ) { return \ spl_object_hash ( $ function [ 0 ] ) . $ function [ 1 ] ; } elseif ( count ( $ function ) > 1 || is_string ( $ function [ 0 ] ) ) { // call as static return $ function [ 0 ] . '::' . $ function [ 1 ] ; } // unexpected result return null ; }
Create Unique ID if function is not string

@param callable $function function to call

@access private
@return string|bool|null
Create Unique ID if function is not string