Skip to content

Commit f122f89

Browse files
Remove custom grouping
1 parent fd688d3 commit f122f89

8 files changed

Lines changed: 10 additions & 10 deletions

src/Enums/GroupingTypes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Facade\FlareClient\Enums;
44

5+
/** @deprecated */
56
class GroupingTypes
67
{
78
const TOP_FRAME = 'topFrame';

src/Flare.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ public function createReportFromMessage(string $message, string $logLevel): Repo
230230
$this->applicationPath
231231
);
232232

233-
$report->groupByException();
234-
235233
return $this->applyMiddlewareToReport($report);
236234
}
237235

src/Report.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Report
6060
private $openFrameIndex;
6161

6262
/** @var string */
63-
private $groupBy;
63+
private $groupBy ;
6464

6565
public static function createForThrowable(Throwable $throwable, ContextInterface $context, ?string $applicationPath = null): self
6666
{
@@ -221,13 +221,15 @@ public function userProvidedContext(array $userProvidedContext)
221221
return $this;
222222
}
223223

224+
/** @deprecated */
224225
public function groupByTopFrame()
225226
{
226227
$this->groupBy = GroupingTypes::TOP_FRAME;
227228

228229
return $this;
229230
}
230231

232+
/** @deprecated */
231233
public function groupByException()
232234
{
233235
$this->groupBy = GroupingTypes::EXCEPTION;
@@ -270,7 +272,6 @@ public function toArray()
270272
'stage' => $this->stage,
271273
'message_level' => $this->messageLevel,
272274
'open_frame_index' => $this->openFrameIndex,
273-
'group_by' => $this->groupBy ?? GroupingTypes::TOP_FRAME,
274275
'application_path' => $this->applicationPath,
275276
];
276277
}

tests/ReportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public function it_can_create_a_report_with_custom_grouping_type()
6060
}
6161

6262
/** @test */
63-
public function it_groups_by_top_frame_as_a_default()
63+
public function it_does_not_group_by_default()
6464
{
6565
$report = Report::createForMessage('this is a message', 'Log', new ConsoleContext());
6666

6767
$reportData = $report->toArray();
6868

69-
$this->assertSame($reportData['group_by'], GroupingTypes::TOP_FRAME);
69+
$this->assertNull($reportData['group_by']);
7070
}
7171

7272
/** @test */

tests/__snapshots__/FlareTest__it_can_report_an_exception__1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ context:
1414
stage: null
1515
message_level: null
1616
open_frame_index: null
17-
group_by: topFrame
17+
group_by: null
1818
application_path: null

tests/__snapshots__/ReportTest__it_can_create_a_report__1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ context:
1414
stage: null
1515
message_level: null
1616
open_frame_index: null
17-
group_by: topFrame
17+
group_by: null
1818
application_path: null

tests/__snapshots__/ReportTest__it_can_create_a_report_for_a_string_message__1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ context:
1414
stage: null
1515
message_level: null
1616
open_frame_index: 0
17-
group_by: topFrame
17+
group_by: null
1818
application_path: null

tests/__snapshots__/ReportTest__it_can_create_a_report_with_glows__1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ context:
2121
stage: null
2222
message_level: null
2323
open_frame_index: null
24-
group_by: topFrame
24+
group_by: null
2525
application_path: null

0 commit comments

Comments
 (0)