Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Spatie\FlareClient;
4
 
5
use Spatie\Backtrace\Frame as SpatieFrame;
6
 
7
class Frame
8
{
9
    protected SpatieFrame $frame;
10
 
11
    public static function fromSpatieFrame(SpatieFrame $frame): self
12
    {
13
        return new self($frame);
14
    }
15
 
16
    public function __construct(SpatieFrame $frame)
17
    {
18
        $this->frame = $frame;
19
    }
20
 
21
    public function toArray(): array
22
    {
23
        return [
24
            'file' => $this->frame->file,
25
            'line_number' => $this->frame->lineNumber,
26
            'method' => $this->frame->method,
27
            'class' => $this->frame->class,
28
            'code_snippet' => $this->frame->getSnippet(30),
29
            'application_frame' => $this->frame->applicationFrame,
30
        ];
31
    }
32
}