static function Util::callbackToString in X Autoload 7.5
Same name and namespace in other branches
- 7.4 lib/Util.php \Drupal\xautoload\Util::callbackToString()
Get a string representation of a callback for debug purposes.
Parameters
callback $callback: A PHP callback, which could be an array or a string.
Return value
string A string representation to be displayed to a user, e.g. "Foo::staticMethod()", or "Foo->bar()"
2 calls to Util::callbackToString()
- EnvironmentSnapshotMaker::buildSnapshot in lib/
Drupal/ xautoload/ Tests/ EnvironmentSnapshotMaker.php - XAutoloadUnitTestCase::testAutoloadStackOrder in lib/
Drupal/ xautoload/ Tests/ XAutoloadUnitTestCase.php
File
- src/
Util.php, line 92
Class
- Util
- A number of static methods that don't interact with any global state.
Namespace
Drupal\xautoloadCode
static function callbackToString($callback) {
if (is_array($callback)) {
list($obj, $method) = $callback;
if (is_object($obj)) {
$str = get_class($obj) . '->' . $method . '()';
}
else {
$str = $obj . '::';
$str .= $method . '()';
}
}
else {
$str = $callback;
}
return $str;
}