abstract class StaticCallLog in X Autoload 7.5
Hierarchy
- class \Drupal\xautoload\Tests\Util\StaticCallLog
Expanded class hierarchy of StaticCallLog
3 files declare their use of StaticCallLog
- AbstractDrupalBootTest.php in tests/
src/ DrupalBootTest/ AbstractDrupalBootTest.php - DrupalBootHookTest.php in tests/
src/ DrupalBootTest/ DrupalBootHookTest.php - DrupalBootTest.php in tests/
src/ DrupalBootTest/ DrupalBootTest.php
File
- tests/
src/ Util/ StaticCallLog.php, line 7
Namespace
Drupal\xautoload\Tests\UtilView source
abstract class StaticCallLog {
/**
* @var CallLog|null
*/
private static $callLog;
/**
* @param CallLog $callLog
*
* @throws \Exception
*/
static function setCallLog(CallLog $callLog) {
if (isset(self::$callLog)) {
throw new \Exception("StaticCallLog already initialized.");
}
self::$callLog = $callLog;
}
/**
* Uninitialize.
*
* @throws \Exception
*/
static function unsetCallLog() {
if (!isset(self::$callLog)) {
throw new \Exception("StaticCallLog not initialized yet.");
}
self::$callLog = NULL;
}
/**
* called from stream wrapper code in
* @see ExampleModules::setupExampleModuleFiles()
*
* @throws \Exception
*/
static function addCall() {
if (!isset(self::$callLog)) {
throw new \Exception("StaticCallLog not initialized yet.");
}
$trace = version_compare(PHP_VERSION, '5.4.0', '>=') ? debug_backtrace(0, 2) : debug_backtrace(0);
$call = $trace[1];
$callFiltered = array();
foreach (array(
'function',
'class',
'type',
) as $key) {
if (isset($call[$key])) {
$callFiltered[$key] = $call[$key];
}
}
$callFiltered['args'] = array();
foreach ($call['args'] as $arg) {
if (is_array($arg)) {
$arg = '(array)';
}
elseif (is_object($arg)) {
$arg = '(' . get_class($arg) . ')';
}
$callFiltered['args'][] = $arg;
}
self::$callLog
->addCall($callFiltered);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StaticCallLog:: |
private static | property | ||
StaticCallLog:: |
static | function | called from stream wrapper code in | |
StaticCallLog:: |
static | function | ||
StaticCallLog:: |
static | function | Uninitialize. |