Kraken\Throwable\Throwable::getThrowableStack PHP Метод

getThrowableStack() публичный статический Метод

Return throwable stack in recursive array format.
public static getThrowableStack ( Error | Exception $ex, &$data = [], integer $offset ) : mixed
$ex Error | Exception
$offset integer
Результат mixed
    public static function getThrowableStack($ex, &$data = [], $offset = 0)
    {
        $data = static::getThrowableData($ex, $offset);
        if (($current = $ex->getPrevious()) !== null) {
            static::getThrowableStack($current, $data['prev'], count(static::getTraceElements($ex)));
        }
        return $data;
    }

Usage Example

Пример #1
0
 /**
  *
  */
 public function testStaticApiGetThrowableStack_ReturnsStack_ForException()
 {
     $prev = $this->createException('Previous');
     $ex = $this->createException($message = 'Exception', $prev);
     $stack = Throwable::getThrowableStack($ex);
     $this->assertData($stack);
     $this->assertData($stack['prev']);
 }