Skip to content

Commit 6d738fe

Browse files
authored
feat: add eventContext in facade (#164)
1 parent e7798a5 commit 6d738fe

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Facades/Honeybadger.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* @method static \Honeybadger\Contracts\Reporter context(int|string|array $key, $value = null)
1515
* @method static \Honeybadger\Contracts\Reporter addBreadcrumb(string $message, array $metadata = [], string $category = 'custom')
1616
* @method static \Honeybadger\Contracts\Reporter resetContext()
17-
* @method static \Honeybadger\Contracts\Reporter clear()
17+
* @method static \Honeybadger\Contracts\Reporter clear(bool $clearEventContext = false)
18+
* @method static \Honeybadger\Contracts\Reporter clearEventContext()
19+
* @method static \Honeybadger\Contracts\Reporter eventContext(int|string|array $key, $value = null)
1820
*/
1921
class Honeybadger extends Facade
2022
{

tests/LogEventDriverTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function addBreadcrumb(string $message, array $metadata = [], string $cat
7171
return $this;
7272
}
7373

74-
public function clear(): Reporter
74+
public function clear($clearEventContext = false): Reporter
7575
{
7676
return $this;
7777
}
@@ -86,6 +86,16 @@ public function flushEvents(): void
8686
$this->events = [];
8787
}
8888

89+
public function eventContext($key, $value = null): Reporter
90+
{
91+
return $this;
92+
}
93+
94+
public function clearEventContext(): Reporter
95+
{
96+
return $this;
97+
}
98+
8999
/**
90100
* Accessor method to the events array.
91101
*

0 commit comments

Comments
 (0)