Skip to content

Commit 518d17d

Browse files
gsousadevgsousadev
andauthored
Fix: Corrigindo busca de atributos file e code de exception previa diretamente, sem usar o get (#7)
Co-authored-by: gsousadev <[email protected]>
1 parent e8f463e commit 518d17d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Exceptions/ProblemDetailException.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ public function toArray(): array
5858
ExceptionsFieldsEnum::MESSAGE->value => $this->message,
5959
ExceptionsFieldsEnum::USER_MESSAGE->value => $this->userMessage,
6060
ExceptionsFieldsEnum::USER_TITLE->value => $this->userTitle,
61-
ExceptionsFieldsEnum::LOCATION->value => $this->file . ':' . $this->line,
61+
ExceptionsFieldsEnum::LOCATION->value => ($this->getFile() . ':' . $this->getLine()),
6262
ExceptionsFieldsEnum::TRACE_ID->value => data_get(Log::sharedContext(), 'trace_id'),
6363
ExceptionsFieldsEnum::PREVIOUS_MESSAGE->value => $this->previous->getMessage() ?? null,
6464
ExceptionsFieldsEnum::PREVIOUS_TYPE->value => $this->previous::class ?? null,
6565
ExceptionsFieldsEnum::PREVIOUS_CODE->value => $this->previous->getCode() ?? null,
66-
ExceptionsFieldsEnum::PREVIOUS_LOCATION->value => $this->previous->file . ':' . $this->previous->line ??
67-
null,
66+
ExceptionsFieldsEnum::PREVIOUS_LOCATION->value => ($this->previous->getFile() . ':' .
67+
$this->previous->getLine()) ?? null,
6868
];
6969

70+
7071
return array_filter(
7172
$allFields,
7273
function ($key) {

0 commit comments

Comments
 (0)