Skip to content

Commit 4575213

Browse files
author
ace-n
committed
rm unneeded use stmts + use type hints
1 parent c00f816 commit 4575213

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

functions/slack_slash_command/index.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
use Psr\Http\Message\ResponseInterface;
2121
use GuzzleHttp\Psr7\Response;
2222

23-
use Google_Service_Kgsearch;
24-
use Google_Service_Kgsearch_SearchResponse;
25-
2623
// [END functions_slack_setup]
2724

2825
// [START functions_verify_webhook]
@@ -60,7 +57,7 @@ function isValidSlackWebhook(ServerRequestInterface $request): bool
6057
/**
6158
* Format the Knowledge Graph API response into a richly formatted Slack message.
6259
*/
63-
function formatSlackMessage($kgResponse, $query): string
60+
function formatSlackMessage(Google_Service_Kgsearch_SearchResponse $kgResponse, string $query): string
6461
{
6562
$responseJson = [
6663
'response_type' => 'in_channel',
@@ -109,7 +106,7 @@ function formatSlackMessage($kgResponse, $query): string
109106
/**
110107
* Send the user's search query to the Knowledge Graph API.
111108
*/
112-
function searchKnowledgeGraph($query): Google_Service_Kgsearch_SearchResponse
109+
function searchKnowledgeGraph(string $query): Google_Service_Kgsearch_SearchResponse
113110
{
114111
/**
115112
* Unlike most other Cloud Functions languages, PHP does not preserve

0 commit comments

Comments
 (0)