Skip to content

Commit aacbb41

Browse files
committed
feat: refactor comment generation logic into a separate method
1 parent a935765 commit aacbb41

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Services/GithubService.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,19 @@ public function handleComment(array $payload): void
6363

6464
$this->commentOnNode(
6565
(string) $payload['projects_v2_item']['content_node_id'],
66-
view('github-project::md.comment', compact('payload'))->render()
66+
$this->generateCommentMessage($payload)
6767
);
6868
}
69+
70+
/**
71+
* Generate the comment message from payload without posting it
72+
*
73+
* @param array<string, mixed> $payload
74+
*
75+
* @throws \Throwable
76+
*/
77+
public function generateCommentMessage(array $payload): string
78+
{
79+
return view('github-project::md.comment', compact('payload'))->render();
80+
}
6981
}

0 commit comments

Comments
 (0)