You are here

private function HandlerStack::debugCallable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/HandlerStack.php \GuzzleHttp\HandlerStack::debugCallable()

Provides a debug string for a given callable.

Parameters

array|callable $fn Function to write as a string.:

Return value

string

1 call to HandlerStack::debugCallable()
HandlerStack::__toString in vendor/guzzlehttp/guzzle/src/HandlerStack.php
Dumps a string representation of the stack.

File

vendor/guzzlehttp/guzzle/src/HandlerStack.php, line 258

Class

HandlerStack
Creates a composed Guzzle handler function by stacking middlewares on top of an HTTP handler function.

Namespace

GuzzleHttp

Code

private function debugCallable($fn) {
  if (is_string($fn)) {
    return "callable({$fn})";
  }
  if (is_array($fn)) {
    return is_string($fn[0]) ? "callable({$fn[0]}::{$fn[1]})" : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])";
  }
  return 'callable(' . spl_object_hash($fn) . ')';
}