File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,17 @@ public function __construct(WebhookService $webhookService, GithubService $githu
2222 /**
2323 * Generate a comment message from the webhook payload
2424 *
25- * @param array<string, mixed> $payload The GitHub webhook payload
25+ * @param array<string, mixed>|object $payload
2626 * @param bool $validate Whether to validate the payload (default: true)
2727 *
2828 * @return JsonResponse
2929 * @throws Throwable
3030 */
31- public function __invoke (array $ payload , bool $ validate = true ): JsonResponse
31+ public function __invoke (array | object $ payload , bool $ validate = true ): JsonResponse
3232 {
3333 try {
34+ $ payload = is_object ($ payload ) ? (array ) $ payload : $ payload ;
35+
3436 if ($ validate ) {
3537 $ validationResponse = $ this ->webhookService ->validatePayload ($ payload );
3638 if ($ validationResponse !== null ) {
You can’t perform that action at this time.
0 commit comments