public static function fromInvalidCallable(
        array $inProgressMakes,
        $callableOrMethodStr,
        \Exception $previous = null
    ) {
        $callableString = null;

        if (is_string($callableOrMethodStr)) {
            $callableString .= $callableOrMethodStr;
        } else if (is_array($callableOrMethodStr) && 
            array_key_exists(0, $callableOrMethodStr) &&
            array_key_exists(0, $callableOrMethodStr)) {
            if (is_string($callableOrMethodStr[0]) && is_string($callableOrMethodStr[1])) {
                $callableString .= $callableOrMethodStr[0].'::'.$callableOrMethodStr[1];
            } else if (is_object($callableOrMethodStr[0]) && is_string($callableOrMethodStr[1])) {
                $callableString .= sprintf(
                    "[object(%s), '%s']",
                    get_class($callableOrMethodStr[0]),
                    $callableOrMethodStr[1]
                );
            }
        }

        if ($callableString) {
            // Prevent accidental usage of long strings from filling logs. 
            $callableString = substr($callableString, 0, 250);
            $message = sprintf(
                "%s. Invalid callable was '%s'",
                Injector::M_INVOKABLE,
                $callableString
            );
        } else {
            $message = \Auryn\Injector::M_INVOKABLE;
        }

        return new self($inProgressMakes, $message, Injector::E_INVOKABLE, $previous);
    }
public static function fromInvalidCallable(
        array $inProgressMakes,
        $callableOrMethodStr,
        \Exception $previous = null
    ) {
        $callableString = null;

        if (is_string($callableOrMethodStr)) {
            $callableString .= $callableOrMethodStr;
        } else if (is_array($callableOrMethodStr) && 
            array_key_exists(0, $callableOrMethodStr) &&
            array_key_exists(0, $callableOrMethodStr)) {
            if (is_string($callableOrMethodStr[0]) && is_string($callableOrMethodStr[1])) {
                $callableString .= $callableOrMethodStr[0].'::'.$callableOrMethodStr[1];
            } else if (is_object($callableOrMethodStr[0]) && is_string($callableOrMethodStr[1])) {
                $callableString .= sprintf(
                    "[object(%s), '%s']",
                    get_class($callableOrMethodStr[0]),
                    $callableOrMethodStr[1]
                );
            }
        }

        if ($callableString) {
            // Prevent accidental usage of long strings from filling logs. 
            $callableString = substr($callableString, 0, 250);
            $message = sprintf(
                "%s. Invalid callable was '%s'",
                Injector::M_INVOKABLE,
                $callableString
            );
        } else {
            $message = \Auryn\Injector::M_INVOKABLE;
        }

        return new self($inProgressMakes, $message, Injector::E_INVOKABLE, $previous);
    }
public static function fromInvalidCallable ( array $ inProgressMakes , $ callableOrMethodStr , \ Exception $ previous = null ) { $ callableString = null ; if ( is_string ( $ callableOrMethodStr ) ) { $ callableString .= $ callableOrMethodStr ; } else if ( is_array ( $ callableOrMethodStr ) && array_key_exists ( 0 , $ callableOrMethodStr ) && array_key_exists ( 0 , $ callableOrMethodStr ) ) { if ( is_string ( $ callableOrMethodStr [ 0 ] ) && is_string ( $ callableOrMethodStr [ 1 ] ) ) { $ callableString .= $ callableOrMethodStr [ 0 ] . '::' . $ callableOrMethodStr [ 1 ] ; } else if ( is_object ( $ callableOrMethodStr [ 0 ] ) && is_string ( $ callableOrMethodStr [ 1 ] ) ) { $ callableString .= sprintf ( "[object(%s), '%s']" , get_class ( $ callableOrMethodStr [ 0 ] ) , $ callableOrMethodStr [ 1 ] ) ; } } if ( $ callableString ) { // Prevent accidental usage of long strings from filling logs.  $ callableString = substr ( $ callableString , 0 , 250 ) ; $ message = sprintf ( "%s. Invalid callable was '%s'" , Injector :: M_INVOKABLE , $ callableString ) ; } else { $ message = \ Auryn \ Injector :: M_INVOKABLE ; } return new self ( $ inProgressMakes , $ message , Injector :: E_INVOKABLE , $ previous ) ; }
Add a human readable version of the invalid callable to the standard 'invalid invokable' message.
Add a human readable version of the invalid callable to the standard invalid invokable message .