Skip to content

Commit

Permalink
fix recursive call issue on getConversations method
Browse files Browse the repository at this point in the history
fix phpdoc
  • Loading branch information
warlof committed Oct 29, 2017
1 parent dff3588 commit 8e5d725
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Repositories/SlackApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function isMemberOf(string $slackId, string $channelId) : bool
* Determine in which channels an user is currently in
*
* @param string $slackId Slack user id (ie: U3216587)
* @param boolean $private Determine if channels should be private (group) or public (channel)
* @param array $types Type of conversation we want check presence
* @throws SlackApiException
* @throws SlackConversationException
* @return array
Expand Down Expand Up @@ -111,7 +111,6 @@ public function getUserConversations(string $slackId, array $types = ['public_ch
* Get information from a specific channel
*
* @param string $channelId Slack channel id (ie: C465478)
* @param boolean $private Determine if channels should be private (group) or public (channel)
* @return array
* @throws SlackApiException
* @throws SlackConversationException
Expand Down Expand Up @@ -160,7 +159,6 @@ public function inviteIntoConversation(string $slackId, string $channelId) : boo
*
* @param string $slackId Slack user id (ie: U3216587)
* @param string $channelId Slack channel id (ie: C6547987)
* @param boolean $private Determine if channels should be private (group) or public (channel)
* @throws SlackApiException
* @return bool
*/
Expand Down Expand Up @@ -192,9 +190,9 @@ public function kickFromConversion(string $slackId, string $channelId) : bool
/**
* Return channels or groups list
*
* @param boolean $private Determine if channels should be private (group) or public (channel)
* @param array $types Types of conversation we want retrieve information
* @param string|null The cursor from which we should start to retrieve information
* @return array
* @throws SlackApiException
* @throws SlackConversationException
*/
public function getConversations(
Expand All @@ -220,7 +218,7 @@ public function getConversations(
// recursive call in order to retrieve all paginated results
if (array_key_exists('response_metadata', $result) && $result['response_metadata']['next_cursor'] != "") {
$channels = array_merge($channels,
$this->getConversations($params['types'], $result['response_metadata']['next_cursor']));
$this->getConversations($types, $result['response_metadata']['next_cursor']));
}

return $channels;
Expand Down Expand Up @@ -279,8 +277,8 @@ public function getConversationMembers(string $channelId, string $cursor = null)
/**
* Return a list of team members
*
* @param string|null $cursor The cursor from which we should start to retrieve information
* @return array
* @throws SlackApiException
* @throws SlackUserException
*/
public function getTeamMembers(string $cursor = null) : array
Expand Down

0 comments on commit 8e5d725

Please sign in to comment.