1 | <?php |
||
16 | class Report |
||
17 | { |
||
18 | use UsesTime, HasContext; |
||
19 | |||
20 | /** @var \Facade\FlareClient\Stacktrace\Stacktrace */ |
||
21 | private $stacktrace; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $exceptionClass; |
||
25 | |||
26 | /** @var string */ |
||
27 | private $message; |
||
28 | |||
29 | /** @var array */ |
||
30 | private $glows = []; |
||
31 | |||
32 | /** @var array */ |
||
33 | private $solutions = []; |
||
34 | |||
35 | /** @var ContextInterface */ |
||
36 | private $context; |
||
37 | |||
38 | /** @var string */ |
||
39 | private $applicationPath; |
||
40 | |||
41 | /** @var array */ |
||
42 | private $userProvidedContext = []; |
||
43 | |||
44 | /** @var array */ |
||
45 | private $exceptionContext = []; |
||
46 | |||
47 | /** @var Throwable */ |
||
48 | private $throwable; |
||
49 | |||
50 | /** @var string */ |
||
51 | private $notifierName; |
||
52 | |||
53 | /** @var string */ |
||
54 | private $languageVersion; |
||
55 | |||
56 | /** @var string */ |
||
57 | private $frameworkVersion; |
||
58 | |||
59 | /** @var int */ |
||
60 | private $openFrameIndex; |
||
61 | |||
62 | /** @var string */ |
||
63 | private $groupBy; |
||
64 | |||
65 | public static function createForThrowable(Throwable $throwable, ContextInterface $context, ?string $applicationPath = null): self |
||
76 | |||
77 | public static function createForMessage(string $message, string $logLevel, ContextInterface $context, ?string $applicationPath = null): self |
||
89 | |||
90 | public function exceptionClass(string $exceptionClass) |
||
96 | |||
97 | public function getExceptionClass(): string |
||
101 | |||
102 | public function throwable(Throwable $throwable) |
||
108 | |||
109 | public function getThrowable(): ?Throwable |
||
113 | |||
114 | public function message(string $message) |
||
120 | |||
121 | public function getMessage(): string |
||
125 | |||
126 | public function stacktrace(Stacktrace $stacktrace) |
||
132 | |||
133 | public function getStacktrace(): Stacktrace |
||
137 | |||
138 | public function notifierName(string $notifierName) |
||
144 | |||
145 | public function languageVersion(string $languageVersion) |
||
151 | |||
152 | public function frameworkVersion(string $frameworkVersion) |
||
158 | |||
159 | public function useContext(ContextInterface $request) |
||
165 | |||
166 | public function openFrameIndex(?int $index) |
||
172 | |||
173 | public function setApplicationPath(?string $applicationPath) |
||
179 | |||
180 | public function getApplicationPath(): ?string |
||
184 | |||
185 | public function view(?View $view) |
||
191 | |||
192 | public function addGlow(Glow $glow) |
||
198 | |||
199 | public function addSolution(Solution $solution) |
||
205 | |||
206 | public function userProvidedContext(array $userProvidedContext) |
||
212 | |||
213 | public function groupByTopFrame() |
||
219 | |||
220 | public function groupByException() |
||
226 | |||
227 | public function allContext(): array |
||
235 | |||
236 | private function exceptionContext(Throwable $throwable) |
||
244 | |||
245 | public function toArray() |
||
266 | } |
||
267 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: