Example #1
0
 /**
  * Constructs a new backtrace from an debug_backtrace array
  *
  * @param Array $backtrace The backtrace array to build from
  * @return \r8\Backtrace
  */
 public static function from(array $backtrace)
 {
     $result = new self();
     foreach ($backtrace as $event) {
         if (is_array($event)) {
             $result->pushEvent(\r8\Backtrace\Event::from($event));
         }
     }
     $result->pushEvent(new \r8\Backtrace\Event\Main(\r8\Env::request()->getFile()->getPath()));
     return $result;
 }