Skip to content

Commit

Permalink
ref(backend): Migrate extra to context (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored Aug 16, 2024
1 parent bc17e05 commit a5eabe0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Http/SlackClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function postMessage(string $channel, string $text): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $channel, $text): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'channel' => $channel,
'text' => $text,
'slack_response' => $json,
Expand Down Expand Up @@ -74,7 +74,7 @@ public function postBlocks(string $channel, string $blocks): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $channel, $blocks): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'channel' => $channel,
'blocks' => $blocks,
'slack_response' => $json,
Expand Down Expand Up @@ -107,7 +107,7 @@ public function postEphemeral(string $channel, string $user, string $text, ?stri

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $channel, $user, $text, $threadTimestamp): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'channel' => $channel,
'user' => $user,
'text' => $text,
Expand Down Expand Up @@ -138,7 +138,7 @@ public function publishView(string $user, array $view): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $user, $view): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'user_id' => $user,
'view' => $view,
'slack_response' => $json,
Expand Down Expand Up @@ -167,7 +167,7 @@ public function openView(string $triggerId, array $view): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $triggerId, $view): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'trigger_id' => $triggerId,
'view' => $view,
'slack_response' => $json,
Expand Down Expand Up @@ -196,7 +196,7 @@ public function getUser(string $user): array
return $json['user'];
} else {
withScope(function ($scope) use ($json, $user): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'user' => $user,
'slack_response' => $json,
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Service/PollService.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function updatePoll(Poll $poll, string $responseUrl): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $blocks, $responseUrl): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'blocks' => $blocks,
'slack_response' => $json,
'response_url' => $responseUrl,
Expand All @@ -87,7 +87,7 @@ public function deletePoll(Poll $poll, string $responseUrl): void

if ($json['ok'] === false) {
withScope(function ($scope) use ($json, $responseUrl): void {
$scope->setExtras([
$scope->setContext('Slack API', [
'slack_response' => $json,
'response_url' => $responseUrl,
]);
Expand Down

0 comments on commit a5eabe0

Please sign in to comment.