public static toThrowableTrace ( |
||
$ex | ||
return | string[] |
public static function toThrowableTrace($ex)
{
$list = [];
for ($stack = Throwable::getThrowableStack($ex); $stack !== null; $stack = $stack['prev']) {
$list[] = Throwable::parseThrowableMessage($stack);
}
return array_reverse($list);
}
/** * */ public function testStaticApiToThrowableTrace_ReturnsStackThrowable() { $prev = $this->createError('Previous'); $ex = $this->createError('Error', $prev); $this->assertThrowableTrace(Error::toThrowableTrace($ex)); }